WA on #2 MLE on #3
#include<iostream>
#include<stack>
using namespace std;
stack<unsigned long long>S;
int t,n,x;string s;
int main(){
cin>>t;
while(t--){
cin>>n;
while(n--){
cin>>s;
if(s=="push")cin>>x,S.push(x);
else if(s=="pop")
if(S.empty())cout<<"Empty\n";
else S.pop();
else if(s=="query")
if(S.empty())cout<<"Anguei!\n";
else cout<<S.top()<<'\n';
else cout<<S.size()<<'\n';
}
while(S.size())S.pop();
}
return 0;
}