#include <iostream>
#include <stack>
using namespace std;
using ull = unsigned long long;
int t, n;
stack<ull> st;
int main()
{
cin >> t;
while (t--)
{
cin >> n;
while (n--)
{
string s; cin >> s;
if (s == "push")
{
ull x; cin >> x;
st.push(x);
}
else if (s == "pop")
{
if (st.empty()) cout << "Empty" << endl;
else st.pop();
}
else if (s == "size") cout << st.size() << endl;
else
{
if (st.empty()) cout << "Anguei!" << endl;
else cout << st.top() << endl;
}
}
}
return 0;
}
我用的 STL 别喷。