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