#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_skip() while(*rp++>=48) #define rd() ({long _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define rep(v,e) for(long v=0;v>6]|=1ul<>12]|=1ul<<(x>>6); b2|=1ul<<(x>>12); } } while(*rp){ ulong t=*rp; rp+=2; ulong x=rd(); ulong y=rd(); if(t&1){ --x; if(y!=1){ b0[x>>6]|=1ul<>12]|=1ul<<(x>>6); b2|=1ul<<(x>>12); }else{ if(!(b0[x>>6]&=~(1ul<>12]&=~(1ul<<(x>>6)))){ b2&=~(1ul<<(x>>12)); } } } }else{ --x; ulong z=x; { ulong a=b0[y>>6]&(1ul<>6<<6; z=i; goto hogera; } } { ulong a=b1[y>>12]&(1ul<<(y>>6))-1; if(a){ ulong j=63-__builtin_clzl(a)|y>>12<<6; ulong i=63-__builtin_clzl(b0[j])|j<<6; z=i; goto hogera; } } { ulong a=b2&(1ul<<(y>>12))-1; if(a){ ulong k=63-__builtin_clzl(a); ulong j=63-__builtin_clzl(b1[k])|k<<6; ulong i=63-__builtin_clzl(b0[j])|j<<6; z=i; goto hogera; } } hogera:; if(z