k=0 exec"k+=1;i=k;exec'i=sum(int(j)**2for j in str(i));'*9\nif i<2:print k\n"*2000