#include #include using namespace std; using namespace atcoder; using ll = long long; //using mint = modint998244353; int op(int a, int b){return max(a, b);}; int e(){return 0;}; int main(){ cin.tie(nullptr); ios_base::sync_with_stdio(false); int Q, now=0; cin >> Q; segtree tree(Q); while(Q--){ int t, x; cin >> t >> x; if (t == 1){ tree.set(now, x); now++; } else{ cout << tree.prod(now-x, now) << endl; } } return 0; }