from heapq import heappush, heappop

s = eval(input())

K = int(eval(input()))

N = len(s)

heap = []

cnt = 0

for i in range(N):

	for j in range(i+1, min(i+K+1, N+1)):

		heappush(heap, s[i:j])



l = list(set(heap))

l.sort()

print((l[K-1]))
s = eval(input())

K = int(eval(input()))

N = len(s)

l = []

cnt = 0

for i in range(N):

	for j in range(i+1, min(i+K+1, N+1)):

		l.append(s[i:j])



l = list(set(l))

l.sort()

print((l[K-1]))
from heapq import heappush, heappop

s = eval(input())
K = int(eval(input()))
N = len(s)
heap = []
cnt = 0
for i in range(N):
    for j in range(i + 1, min(i + K + 1, N + 1)):
        heappush(heap, s[i:j])
l = list(set(heap))
l.sort()
print((l[K - 1]))

s = eval(input())
K = int(eval(input()))
N = len(s)
l = []
cnt = 0
for i in range(N):
    for j in range(i + 1, min(i + K + 1, N + 1)):
        l.append(s[i:j])
l = list(set(l))
l.sort()
print((l[K - 1]))

-from heapq import heappush, heappop - -heap = [] +l = [] -        heappush(heap, s[i:j]) -l = list(set(heap)) +        l.append(s[i:j]) +l = list(set(l))