n = 500 S = [] t = 2 for i in range(1, 10): S += [i] * t t *= 2 n = int(input()) print(*S[:n], sep="")