Buggy python submission (verdict: Time Limit Exceeded):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        t = s[i:j+1]
        if t not in li:
            li.append(s[i:j+1])
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, len(s)):
        t = s[i:j+1]
        if t not in li:
            li.append(s[i:j+1])
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[i:j+1] not in li:
            li.append(s[i:j+1])
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Buggy python submission (verdict: Runtime Error):
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[i:j+1] not in li:
            li.append(s[i:j+1])
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, len(s)):
        if s[i:j+1] not in li:
            li.append(s[i:j+1])
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import deque
from collections import  Counter
import statistics
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, len(s)):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])

Fixed submission:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

s = input()
k = ni()
li = []
for i in range(len(s)):
    for j in range(i, i+k+1):
        li.append(s[i:j+1])
li = list(set(li))
li.sort()
print(li[k-1])