# your code goes here N=int(input()) Se=7 i=0 while N>=Se: Se*=7 Se//=7 Ns=[] while N>=1: Ns.append(N//Se) # print (Se) N%=Se Se//=7 if N==0: Ns.append(0) Nst=[str(i) for i in Ns] Nj="".join(Nst) print (Nj)