// ------------------------------------ // Date:2018/ 2/22 // Problem:No.649 Level3 ここでちょっとQK! 0649.cpp // // ------------------------------------ #include using namespace std; #define EACH(i,a) for (auto&& i : a) #define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i) #define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i) #define REP(i,n) FOR(i,0,n) #define RREP(i,n) RFOR(i,0,n) #define ALL(a) (a).begin(),(a).end() using ll = long long; int main() { int Q,K,num,v; vector S; REP(i,Q) { cin >> num; if (num == 1) { cin >> v; S.emplace_back(v); } else { if (S.size() < K) { cout << -1 << endl; } else { cout << S[K] << endl; } } } return 0; }