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