#include<bits/stdc++.h>
using namespace std;
#define int unsigned long long
stack<int> e;
signed main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
int n;
cin>>n;
for(int i=1;i<=n;i++){
string in;
cin>>in;
if(in=="push"){
int x;
cin>>x;
e.push(x);
}
if(in=="query"){
if(!e.empty())
cout<<"Anguei!\n";
else
cout<<e.top()<<"\n";
}
if(in=="size"){
cout<<e.size()<<"\n";
}
if(in=="pop"){
if(!e.empty()) e.pop();
else cout<<"Empty\n";
}
}
}
while(e.size()!=0) e.pop();
return 0;
}
求救