output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
attempt: k = int(input())
  num_digit = [0] * 10  # num_digit[i]は10^i以下のルンルン数の個数
  num_digit[0] = 9
  tmp = [[0] * 10 for i in range(10)]  # tmp[i][j]はi+1桁で最高位jの個数
  tmp[0] = [0, 1, 1, 1, 1, 1, 1, 1, 1, 1]
  for i in range(1, 9):
      num_digit[i] = num_digit[i - 1]
      tmp[i][0] = tmp[i - 1][0] + tmp[i - 1][1]
      num_digit[i] += tmp[i][0]
      for j in range(1, 9):
          tmp[i][j] = tmp[i - 1][j - 1] + tmp[i - 1][j] + tmp[i - 1][j + 1]
          num_digit[i] += tmp[i][j]
      tmp[i][9] = tmp[i - 1][8] + tmp[i - 1][9]
      num_digit[i] += tmp[i][9]
  
  
  def lnln(n):
      ans = 0
      d = 0
      tmp_n = n
      while num_digit[d] < n:
          d += 1
      tmp_n -= num_digit[d - 1]
      while tmp[d][ans] < tmp_n:
          tmp_n -= tmp[d][ans]
          ans += 1
      ans *= 10**d
      if n > 9:
          ans += lnln(tmp_n)
      return ans
  
  
  print(lnln(k))
  
problem_description: Statement
  
  A positive integer X is said to be a lunlun number if and only if the
  following condition is satisfied:
  
    * In the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.
  
  For example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or
  13579 is.
  
  You are given a positive integer K. Find the K-th smallest lunlun number.
samples: [{"input": "15", "output": "23\n    \n\nWe will list the 15 smallest lunlun numbers in ascending order:  \n1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23.  \nThus, the answer is 23.\n\n* * *"}, {"input": "1", "output": "1\n    \n\n* * *"}, {"input": "13", "output": "21\n    \n\n* * *"}, {"input": "100000", "output": "3234566667\n    \n\nNote that the answer may not fit into the 32-bit signed integer type."}]