#include using namespace std; int main() { int m; cin >> m; vector v; for (int i = 0; i < m; ++i) { int op; int x; int found; cin >> op; if (op == 1) { cin >> x; v.push_back(x); } else if (op == 2) { if (v.size()) v.pop_back(); } else { cin >> x; found = 0; for (auto it : v) if (it <= x) cout << it << ' ', found = 1; if (found) cout << '\n'; else cout << "Empty\n"; } } return 0; }