s="" for i in range(2,10): for j in range(2**(i-1)): s+="1" s+=str(i) print(s[:int(input())])