#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define rd(v) long v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} #define wt_rev(v) {long _z=v;do*--wp=_z%10+48;while(_z/=10);} main(){ char*rp=mmap(0l,1l<<12,1,2,0,0ll); rd(n); long r; if(n%3==0){ r=3; goto end; } if(n%4==0){ r=4; goto end; } long e=sqrt(n); for(r=3;r<=e;r+=2){ if(n%r==0){ goto end; } } if(n%2==0){ r=n/2; goto end; } r=n; end:; char wbuf[32],*wp=(wbuf+sizeof wbuf); wt_rev(r); write(1,wp,(wbuf+sizeof wbuf)-wp); _exit(0); }