#include #include using namespace std; using dat=pair; dat op(dat a,dat b){return a>N>>M; vectorinit(M); for(int i=0;i>a; init[i]=make_pair(a,i); } atcoder::segtreeP(init); int Q;cin>>Q; for(;Q--;) { int t,x; long y; cin>>t>>x>>y; x--; if(t==1) { dat now=P.get(x); now.first+=y; P.set(x,now); } else if(t==2) { dat now=P.get(x); now.first-=y; P.set(x,now); } else { cout<