n=input() d=1 exec"d+=1;m=n;s=''\nwhile m:s=chr(m%d+48+39*(m%d>9))+s;m/=d\nprint s;"*35