#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;cin>>q; segtree sg(q); int r=0; while(q--){ int op;cin>>op; if(op==1){ int x;cin>>x; sg.set(r++,x); }else{ int k;cin>>k; cout<