Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

K = int(stdin.readline().rstrip())
a = list(range(1,10))
b = []
attack = 100000
while attack > 0:
    go = a.pop(0)
    ue = go*10
    shimo = go%10
    b.append(go)
    if shimo == 0:
        a.append(ue)
        a.append(ue+1)
    elif shimo == 9:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
    else:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
        a.append(ue+shimo+1)
    attack -= 1

print(b[K-1])

Fixed submission:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque
import math
# stdin = open("sample.txt")

K = int(stdin.readline().rstrip())
a = deque(range(1,10))
ans_list = []
attack = 100000
while attack > 0:
    ans = a.popleft()
    ue = ans*10
    shimo = ans%10
    ans_list.append(ans)
    if shimo == 0:
        a.append(ue)
        a.append(ue+1)
    elif shimo == 9:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
    else:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
        a.append(ue+shimo+1)
    attack -= 1

print(ans_list[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

K = int(stdin.readline().rstrip())
a = list(range(1,10))
b = []
attack = 100000
while attack > 0:
    go = a.pop(0)
    ue = go*10
    shimo = go%10
    b.append(go)
    if shimo == 0:
        a += (ue,ue+1)
    elif shimo == 9:
        a += (ue+shimo-1,ue+shimo)
    else:
        a += (ue+shimo-1,ue+shimo,ue+shimo+1)
    attack -= 1

print(b[K-1])

Fixed submission:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque
import math
# stdin = open("sample.txt")

K = int(stdin.readline().rstrip())
a = deque(range(1,10))
ans_list = []
attack = 100000
while attack > 0:
    ans = a.popleft()
    ue = ans*10
    shimo = ans%10
    ans_list.append(ans)
    if shimo == 0:
        a.append(ue)
        a.append(ue+1)
    elif shimo == 9:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
    else:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
        a.append(ue+shimo+1)
    attack -= 1

print(ans_list[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
import math
# stdin = open("sample.txt")

def keta(kazu):
    kazu_str = str(kazu)
    kazu_list = [int(kazu_str[i]) for i in range(0, len(kazu_str))]
    return kazu_list

K = int(stdin.readline().rstrip())
a = list(range(1,10))
b = []

for i in range(100000):
    go = a.pop(0)
    ue = go*10
    shimo = go%10
    b.append(go)
    if shimo == 0:
        a += (ue,ue+1)
    elif shimo == 9:
        a += (ue+shimo-1,ue+shimo)
    else:
        a += (ue+shimo-1,ue+shimo,ue+shimo+1)

print(b[K-1])

Fixed submission:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
from collections import deque
import math
# stdin = open("sample.txt")

K = int(stdin.readline().rstrip())
a = deque(range(1,10))
ans_list = []
attack = 100000
while attack > 0:
    ans = a.popleft()
    ue = ans*10
    shimo = ans%10
    ans_list.append(ans)
    if shimo == 0:
        a.append(ue)
        a.append(ue+1)
    elif shimo == 9:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
    else:
        a.append(ue+shimo-1)
        a.append(ue+shimo)
        a.append(ue+shimo+1)
    attack -= 1

print(ans_list[K-1])