#include<bits/stdc++.h>
using namespace std;
stack<string>s;
int main()
{
long long t,n;
cin>>t;
while(n--){
cin>>n;
while(s.size())s.pop();
for(int i=1;i<=n;i++){
string st;cin>>st;
if(st=="push"){
string x;cin>>x;
s.push(x);
}
if(st=="query"){
if(!s.empty())cout<<s.top()<<endl;
else cout<<"Anguei!"<<endl;
}
if(st=="size"){
cout<<s.size()<<endl;
}
if(st=="pop"){
if(s.empty())cout<<"Empty"<<endl;
else s.pop();
}
}
}
return 0;
}
不知道为什么会超时