#include<bits/stdc++.h>
using namespace std;
int t;
int main(){
cin>>t;
while(t--){
int n;
cin>>n;
stack<unsigned long long> s;
for(int i = 0;i < n;i++){
string c;
cin>>c;
if(c == "push"){
int x;
cin>>x;
s.push(x);
}
if(c == "pop"){
if(s.empty()){
cout<<"Empty"<<endl;
continue;
}
s.pop();
}
if(c == "query"){
if(s.empty()){
cout<<"Anguei!"<<endl;
continue;
}
cout<<s.top()<<endl;
}
if(c == "size"){
cout<<s.size()<<endl;
}
}
}
}
RT,代码如上