#include #include using namespace std; ifstream f("A.in"); ofstream g("A.out"); vector < int > stiva; int n, i, j, a, b, sze, check; int main() { f >> n; for(i = 1; i <= n; i++) { f >> a; if(a == 1) { f >> b; stiva.push_back(b); } if(a == 2) stiva.pop_back(); if(a == 3) { check = 0; f >> b; sze = stiva.size() - 1; for(j = 0; j <= sze; j++) if(b >= stiva[j]) { g << stiva[j] <<" "; check = 1; } if(!check) g << "Empty"; g << "\n"; } } }