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