Buggy python submission (verdict: Runtime Error):
s = input()
N = int(input())
l = len(s)
result=[]
for first in range(l):
  for scope in range(1,1+l-first):
    if not s[first:first+scope]:
      result.append(s[first:first+scope])
result.sort()
print(result[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s = input()
N = int(input())
l = len(s)
li=list(set(s))
li.sort()
result=[]

if len(li)>5:
    a=5
else:
    a=l-1
for i in range(a):
    indexx=[f for f,x in enumerate(s) if x==s[i]]
    for index in indexx:
        for scope in range(1,l+1):
            if not s[index:index+scope] in result:
                result.append(s[index:index+scope])
                result.sort()


print(result)
print(result[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s = input()
N = int(input())
l = len(s)
li=list(set(s))
li.sort()
result=[]
print(li)
if len(li)>5:
    a=5
else:
    a=l-1
for i in range(a):
    index=s.index(li[i])
    for scope in range(1,l+1):
        if not s[index:index+scope] in result:
            result.append(s[index:index+scope])
result.sort()
print(result)
print(result[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s = input()
N = int(input())
l = len(s)
li=list(set(s))
li.sort()
result=[]
print(li)
if len(li)>5:
    a=5
else:
    a=l-1
for i in range(a):
    index=s.index(li[i])
    for scope in range(1,l+1):
        if not s[index:index+l-scope+1] in result:
            result.append(s[index:index+l-scope+1])
print(result)
result.sort()
print(result[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
N = int(input())
l = len(s)
li=[]
for scope in range(1,l+1):
    for first in range(l-scope+1):
        if not s[first:first+scope] in li:
            li.append(s[first:first+scope])

li.sort()
print(li[N-1])









Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
N=int(input())
l=len(s)
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
    if len(li)==N:
      break
li.sort()   
print(li[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
N=int(input())
l=len(s)
li=[]
for scope in range(1,l+1):
  for first in range(l-scope+1):
    if not s[first:first+scope]:
      li.append(s[first:first+scope])
li.sort()
print(li[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
N=int(input())
l=len(s)
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
li.sort()   
print(li[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
N=int(input())
l=len(s)
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
li.sort()   
print(li[N-1])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
N=int(input())
l=len(s)
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
li.sort()   
print(li[N])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])

Buggy python submission (verdict: Runtime Error):
s=input()
l=len(s)
N=int(input())
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
print(li[-N])

Fixed submission:
str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])