#include #include #include using namespace std; using namespace atcoder; int op(int x, int y){ return max(x, y); } int e(){ return 0; } int main(){ int Q, M = 200010, L = 0; cin >> Q; segtree seg(M); while (Q--){ int t, k; cin >> t >> k; if (t == 1) seg.set(L++, k); else cout << seg.prod(L-k, L) << endl; } }