q,r = divmod(int(input())-1,36) for i in range(1,9): for j in range(i+1,10): if not r: exit(print(str(i)+str(j)*(q+1))) r -= 1