N = int(input()) a = N//36 b = N%36 cnt = 0 for i in range(1,9): for j in range(i+1,10): cnt+=1 if cnt==b: print(str(i*10+j)+str(j)*a)