https://www.luogu.com.cn/problem/B3614
#include<bits/stdc++.h>
#include<stack>
using namespace std;
stack<long long> s;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
for(int i=1;i<=n;i++){
string st;
cin>>st;
if(st=="push"){
int 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())s.pop();
else cout<<"Empty"<<endl;
}
}
while(!s.empty()){
s.pop();
}
}
return 0;
}