#pragma GCC optimize("Ofast") #pragma GCC target("avx2") #define rd_init() char*rp=({char*mmap();mmap(0l,1l<<25,1,2,0,0ll);}) #define rd_skip() while(*rp++>=48) #define rd() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define wt(v) ({unsigned _z=v;int _n=0;ulong _d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(ulong*)wp=_d;wp+=_n;}) #define rep(v,e) for(typeof(e) v=0;v=a?v:a) typedef unsigned long ulong; ulong ulbuf[1<<22]; #define wbuf ((char*)ulbuf) void sort_aux(ulong*a,ulong*b,int n,int ph){ int c[1024]; for(int i=0;i<1024;++i){ c[i]=0; } for(int i=0;i>10|a[i]<<54; } }else{ for(int i=0;i>44|a[i]<<20; } } } void sort(ulong*a,int n){ ulong*b=a+n; sort_aux(b,a,n,0); sort_aux(a,b,n,0); sort_aux(b,a,n,1); } #define g ulbuf int h[200000]; int t[200000]; int e[18][200004]; int main(){ rd_init(); int n=rd(); rep(i,n*2){ g[i+n*2]=rd()|(ulong)i<<32; } sort(g,n*2); { int j=0,v=-1; rep(i,n*2){ int k=g[i]>>32; if(k=h[b]){ *wp++='1'; }else{ int c=t[a]; int z=1; rrep(k,18){ if(e[k][c]