#ifndef INCLUDED_MAIN #define INCLUDED_MAIN #include __FILE__ int main(void) { ll q; cin>>q; segtree seg(q,op,e); ll sz=0; rep(i,q) { ll ty,x; cin>>ty>>x; if(ty==1) { seg.set(sz,x); sz++; } if(ty==2) { cout< using namespace std; #define rep(i,n) for(ll i=0;i=l;i--) using ll = long long; using ld = long double; const ll mod=998244353; #define vout(v) for(auto i :v) cout< #define vc vector #define pb push_back ll op(ll a,ll b) {return max(a,b);} ll e() {return -Winf; } template class segtree { function op; function e; ll n; vector seg; ll siz=1; public: segtree(ll n,function op,function e) : n(n),op(op),e(e) { while(siz(2*siz,e()); } void set(ll ind,t val) { ind+=siz; seg[ind]=val; while(ind>>=1) seg[ind]=op(seg[2*ind],seg[2*ind+1]); } t one_p(ll ind) { return seg[ind+siz]; } t prod(ll lef,ll rig) { // [l,r) lef+=siz,rig+=siz; t opl=e(),opr=e(); for(;lef>=1,rig>>=1) { if(lef&1) opl=op(opl,seg[lef++]); if(rig&1) opr=op(seg[--rig],opr); } return op(opl,opr); } template ll max_right(ll lef,c judge) { ll LEF=lef+siz,wid=1; //LEF=seg列上の位置,lef=配列上のindex t ansl=e(); for(;lef+wid<=n;LEF>>=1,wid<<=1) if(LEF&1) { if(!judge(op(ansl,seg[LEF]))) break; ansl=op(ansl,seg[LEF++]); lef+=wid; } while(LEF<<=1,wid>>=1) { //if(wid==0) break; if(lef+wid<=n && judge(op(ansl,seg[LEF]))) { ansl=op(ansl,seg[LEF++]); lef+=wid; } } return lef; } template ll min_left(ll rig,c judge) { ll RIG=rig+siz,wid=1; t ansr=e(); for(;rig-wid>=0;RIG>>=1,wid<<=1) if(RIG&1) { if(!judge(op(seg[RIG-1],ansr))) break; ansr=op(seg[--RIG],ansr); rig-=wid; } while(RIG<<=1,wid>>=1) { //if(wid==0) break; if(rig-wid>=0 && judge(op(seg[RIG-1],ansr))) { ansr=op(seg[--RIG],ansr); rig-=wid; } } return rig; } }; vector Erasieve(ll n) { vector is_prime(n+1, true); is_prime[0] = is_prime[1] = false; for (int i=2;i*i<=n;++i) { if (is_prime[i]) { for (int j=i*i;j<=n;j+=i) is_prime[j] = false; } } vector primes; srep(i,2,n) { if (is_prime[i]) primes.push_back(i); } return primes; } template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} void no() { cout<<"No"<0) { if (po&1) ret=(ret*fl)%mod; fl=(fl*fl)%mod; po>>=1; } } else { while (po>0) { if(po&1) ret*=fl; fl*=fl; po>>=1; } } return ret; } #endif