s = eval(input())

k = int(eval(input()))



cnt = 0

alps = 'abcdefghijklmnopqrstuvwxyz'

for alp in alps:

    inds = []

    for i,si in enumerate(s):

        if si == alp:

            inds.append(i)

    if inds:

        s_set = set()

        for ind in inds:

            for i in range(1,6):

                if ind+i <= len(s):

                    s_set.add(s[ind:ind+i])

        sl = list(s_set)

        if cnt + len(sl) >= k:

            sl.sort()

            print((sl[k-cnt-1]))

            exit()

        else:

            cnt += len(sl)

s = eval(input())

k = int(eval(input()))

n = len(s)



ss = set()

for i in range(n):

    for j in range(5):

        if i+j < n:

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



sl = list(ss)

sl.sort()

print((sl[k-1]))
s = eval(input())
k = int(eval(input()))
cnt = 0
alps = "abcdefghijklmnopqrstuvwxyz"
for alp in alps:
    inds = []
    for i, si in enumerate(s):
        if si == alp:
            inds.append(i)
    if inds:
        s_set = set()
        for ind in inds:
            for i in range(1, 6):
                if ind + i <= len(s):
                    s_set.add(s[ind : ind + i])
        sl = list(s_set)
        if cnt + len(sl) >= k:
            sl.sort()
            print((sl[k - cnt - 1]))
            exit()
        else:
            cnt += len(sl)

s = eval(input())
k = int(eval(input()))
n = len(s)
ss = set()
for i in range(n):
    for j in range(5):
        if i + j < n:
            ss.add(s[i : i + j + 1])
sl = list(ss)
sl.sort()
print((sl[k - 1]))

-cnt = 0 -alps = "abcdefghijklmnopqrstuvwxyz" -for alp in alps: -    inds = [] -    for i, si in enumerate(s): -        if si == alp: -            inds.append(i) -    if inds: -        s_set = set() -        for ind in inds: -            for i in range(1, 6): -                if ind + i <= len(s): -                    s_set.add(s[ind : ind + i]) -        sl = list(s_set) -        if cnt + len(sl) >= k: -            sl.sort() -            print((sl[k - cnt - 1])) -            exit() -        else: -            cnt += len(sl) +n = len(s) +ss = set() +for i in range(n): +    for j in range(5): +        if i + j < n: +            ss.add(s[i : i + j + 1]) +sl = list(ss) +sl.sort() +print((sl[k - 1]))