rt
Code
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
int main(){
int T;
cin>>T;
while(T--){
stack<ull int>s;
int n;
scanf("%d",&n);
while(n--){
string op;
cin>>op;
if(op=="push"){
ull x;
scanf("%d",&x);
s.push(x);
}
else if(op=="pop"){
if(s.empty()) cout<<"Empty\n";
else s.pop();
}
else if(op=="query"){
if(s.empty()) cout<<"Anguei!\n";
else cout<<s.top()<<endl;
}
else cout<<s.size()<<endl;
}
}
return 0;
}