#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() ({int _v=0,_c;while(_c=*rp++-48,_c>=0)_v=_v*10+_c;_v;}) #define wt(v) ({unsigned _z=v;do*--wp=_z%10+48;while(_z/=10);}) #define rep(v,e) for(typeof(e) v=0;v=s;) int a[300001]; int c[300001]; char wbuf[1<<25]; int f1(){ rd_init(); int n=rd(); rep3(i,1,n+1){ if(!a[i]){ int m=0; for(int j=0,k;++j,k=j*j*i,k<=n;){ c[m++]=k; } rep(j,m){ a[c[j]]=c[m+~j]; } } } return n; } void f2(int n){ char*wp=wbuf+sizeof wbuf; rrep3(i,1,n+1){ *--wp=' '; wt(a[i]); } write(1,wp,wbuf+sizeof wbuf-wp); } int main(){ f2(f1()); _exit(0); }