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