#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} char buf[7*2*200000]; int h[200001]; #define WTHI(v) {long _z=v,_n=0,_d=0;while(++_n,_d=_d<<8|0x30|_z%10,_z/=10);*(long*)wp=_d;wp+=_n;} #define WTLO(v) {long _z=v,_n=8,_d=0;while(_d=_d<<8|0x30|_z%10,_z/=10,--_n);*(long*)wp=_d;wp+=8;} #define WT(v) if(z>=100000000){WTHI(z/100000000);WTLO(z);}else{WTHI(z);} main(){ char*rp=mmap(0l,7l*200002,1,2,0,0ll); while(*rp++!=32); RD(m); do{ RD(l); ++h[l]; }while(*rp); char*wp=buf; for(int i=0;++i<=m;){ WTHI(i); *wp++=32; WTHI(h[i]); *wp++=10; } write(1,buf,wp-buf); _exit(0); }