X = [] for a in range(1, 10): for b in range(a+1, 10): X.append((a, b)) n = int(input()) q, r = divmod(n-1, 36) i = 0 a, b = X[r] ans = str(a) for i in range(q+1): ans += str(b) print(ans)