N = int(input()) N -= 1 q, r = divmod(N, 36) for a in range(1, 10): for b in range(a+1, 10): if r == 0: print(str(a) + str(b) * (1 + q)) r -= 1