#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
stack<unsigned long long> s;
int n;
scanf("%d", &n);
while (n--) {
string a;
cin >> a;
if (a == "push") {
unsigned long long x;
cin >> x;
s.push(x);
} else if (a == "query") {
if (s.empty())
puts("Anguei!");
else
printf("%d\n", s.top());
} else if (a == "size")
printf("%d\n", s.size());
else if (a == "pop") {
if (s.empty())
puts("Empty");
else
s.pop();
}
}
}
}
33分