ll@n,@h,a[n],p=0;rep(i,1,n)rep(n%i?0:i)a[h&2h?(p%h*n+p)/h:p]=i,++p;wt(a(n));