s = eval(input())

k = int(eval(input()))





ans_set = set()

for i in range(len(s)):

    c = s[i]

    ans_set.add(c)

    for j in range(i + 1, len(s)):

        c += s[j]

        if len(c) > k:

            break

        ans_set.add(c)





ans_lst = list(ans_set)

ans_lst.sort()

ans = ans_lst[k-1]





print(ans)
s = eval(input())

k = int(eval(input()))





set_ans = set()

for i in range(k):

    for j in range(len(s)):

        set_ans.add(s[j:j+i+1])





lst_ans = list(set_ans)

lst_ans.sort()

ans = lst_ans[k-1]

print(ans)
s = eval(input())
k = int(eval(input()))
ans_set = set()
for i in range(len(s)):
    c = s[i]
    ans_set.add(c)
    for j in range(i + 1, len(s)):
        c += s[j]
        if len(c) > k:
            break
        ans_set.add(c)
ans_lst = list(ans_set)
ans_lst.sort()
ans = ans_lst[k - 1]
print(ans)

s = eval(input())
k = int(eval(input()))
set_ans = set()
for i in range(k):
    for j in range(len(s)):
        set_ans.add(s[j : j + i + 1])
lst_ans = list(set_ans)
lst_ans.sort()
ans = lst_ans[k - 1]
print(ans)

-ans_set = set() -for i in range(len(s)): -    c = s[i] -    ans_set.add(c) -    for j in range(i + 1, len(s)): -        c += s[j] -        if len(c) > k: -            break -        ans_set.add(c) -ans_lst = list(ans_set) -ans_lst.sort() -ans = ans_lst[k - 1] +set_ans = set() +for i in range(k): +    for j in range(len(s)): +        set_ans.add(s[j : j + i + 1]) +lst_ans = list(set_ans) +lst_ans.sort() +ans = lst_ans[k - 1]