#include<bits/stdc++.h>
using namespace std;
long long t,n,x;
string tw;
int main()
{
cin>>t;
for(long long i=1;i<=t;i++)
{
stack<long long>s;
cin>>n;
for(long long j=1;j<=n;j++)
{
cin>>tw;
if(tw=="push")
{
cin>>x;
s.push(x);
}
else if(tw=="pop")
{
if(!s.empty())
{
s.pop();
}
else
{
cout<<"Empty"<<endl;
}
}
else if(tw=="query")
{
if(!s.empty())
{
cout<<s.top()<<endl;
}
else
{
cout<<"Anguei!"<<endl;
}
}
else if(tw=="size")
{
cout<<s.size()<<endl;
}
}
}
return 0;
}
太合理了,对叭