s = input().strip()

k = int(eval(input()))

ss = []

n = len(s)

for i in range(n):

    for j in range(1, 6):

        if i + j <= n:

            ss.append(s[i:i + j])

ss = list(set(ss))

ss.sort()

print((ss[k - 1]))
import sys



input = sys.stdin.readline



ri = lambda: int(eval(input()))

rs = lambda: input().rstrip()

ril = lambda: list(map(int, input().split()))

rsl = lambda: input().rstrip().split()

ris = lambda n: [ri() for _ in range(n)]

rss = lambda n: [rs() for _ in range(n)]

rils = lambda n: [ril() for _ in range(n)]

rsls = lambda n: [rsl() for _ in range(n)]



s = rs()

k = ri()

ss = set()

n = len(s)

for i in range(n):

    for j in range(1, 6):

        ss.add(s[i:i + j])

print((sorted(ss)[k - 1]))
s = input().strip()
k = int(eval(input()))
ss = []
n = len(s)
for i in range(n):
    for j in range(1, 6):
        if i + j <= n:
            ss.append(s[i : i + j])
ss = list(set(ss))
ss.sort()
print((ss[k - 1]))

import sys

input = sys.stdin.readline
ri = lambda: int(eval(input()))
rs = lambda: input().rstrip()
ril = lambda: list(map(int, input().split()))
rsl = lambda: input().rstrip().split()
ris = lambda n: [ri() for _ in range(n)]
rss = lambda n: [rs() for _ in range(n)]
rils = lambda n: [ril() for _ in range(n)]
rsls = lambda n: [rsl() for _ in range(n)]
s = rs()
k = ri()
ss = set()
n = len(s)
for i in range(n):
    for j in range(1, 6):
        ss.add(s[i : i + j])
print((sorted(ss)[k - 1]))

-s = input().strip() -k = int(eval(input())) -ss = [] +import sys + +input = sys.stdin.readline +ri = lambda: int(eval(input())) +rs = lambda: input().rstrip() +ril = lambda: list(map(int, input().split())) +rsl = lambda: input().rstrip().split() +ris = lambda n: [ri() for _ in range(n)] +rss = lambda n: [rs() for _ in range(n)] +rils = lambda n: [ril() for _ in range(n)] +rsls = lambda n: [rsl() for _ in range(n)] +s = rs() +k = ri() +ss = set() -        if i + j <= n: -            ss.append(s[i : i + j]) -ss = list(set(ss)) -ss.sort() -print((ss[k - 1])) +        ss.add(s[i : i + j]) +print((sorted(ss)[k - 1]))