ll x,i;{rd(x);x/=x%((i=(-1e6..-1))*i)?1:i*i;wt(x);}