while 1: a,s,n=input(),'',0 while a>=37**(n+1):n+=1 while n>=0: i,a,n=a/37**n,a%37**n,n-1 s+='0123456789abcdefghijklmnopqrstuvwxyzA'[i] print s