n = int(input()) ans = [[i,j] for i in range(1,9) for j in range(2,10) if i < j] syou = n//36 amari = n%36 print(str(ans[amari-1][0]) + str(ans[amari-1][1])*(syou+1))