#pypy3の再帰速度向上 # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') #再帰回数の上限を上げる # import sys # sys.setrecursionlimit(10**8) #両端キューの宣言 # from collections import deque # d = deque() #メモ化再帰(再帰する関数の上にデコレータを配置) # from functools import lru_cache # @lru_cache(maxsize = 1000000000000000000) #頻出辞書用ライブラリ # from collections import defaultdict # di = defaultdict(int) # コピーライブラリ # import copy # a = copy.copy(b) # INF = float('inf') # abc = "abcdefghijklmnopqrstuvwxyz" # ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" def iinput(): return int(input()) def sinput(): return input().rstrip() def i0input(): return int(input()) - 1 def linput(): return list(input().split()) def liinput(): return list(map(int, input().split())) def miinput(): return map(int, input().split()) def li0input(): return list(map(lambda x: int(x) - 1, input().split())) def mi0input(): return map(lambda x: int(x) - 1, input().split()) # Write code here.--------------------------------------------------------------------------------------- N = iinput() A = 1 B = 2 C = 0 flg = False while True: while A < 10: B = A + 1 while B < 10: N -= 1 if N == 0: flg = True break B += 1 if flg: break A += 1 if flg: break A = 1 C += 1 print(str(A)+str(B)*(C+1))