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