long n,s[9999],i=1,j,k,t;main(x){for(scanf("%ld",&n);(t=n/i*pow(10,t=log10(i)+1)+i,n%i?0:(j?t-s[--j]:!(s[k++]=t))||(i=n/i,j=k,x++%2))||i*i++