N = int(input()) L = [] for i in range(12,100): s = str(i) if int(s[0]) < int(s[1]): L.append(i) le = len(L) y = N//le if N % le == 0: print(str(L[-1])+str(L[-1]%10)*(y-1)) else: x = L[N%le-1] print(str(x)+str(x%10)*y)