while 1: q="";n=input()+2&2**32-1 while n>2:q=chr(60+n%31)+q;n/=31 print q