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