N=int(input())-1 d,r=divmod(N,36) v=0 for i in range(1,10): for j in range(i+1,10): if v==r: p,q=i,j v+=1 print(str(p)+str(q)*(d+1))