#include #include #include #include #include using namespace std; using namespace atcoder; using ll=long long; using Pll=pair; Pll op(Pll a,Pll b){ if(a.first>b.first){ return a; }else{ return b; } } Pll e(){ return make_pair(-1LL,-1LL); } int main(){ ll N,M; cin>>N>>M; vectorA(M); for(int i=0;i>A.at(i).first; A.at(i).second=i+1; } ll Q; cin>>Q; segtree seg(A); for(int i=0;i>T>>X>>Y; if(T==1){ Pll d=seg.get(X-1); seg.set(X-1,make_pair(d.first+Y,d.second)); }else if(T==2){ Pll d=seg.get(X-1); seg.set(X-1,make_pair(d.first-Y,d.second)); }else{ cout<