s = eval(input())

l = int(eval(input()))

char = []

if len(s) == 1:

    print(s)

else:

    for i in range(len(s)):

        char.append(s[i])

    charset = set(char)

    ans = []

    for i in charset:

        for j in range(len(s)):

            if i == s[j]:

                for k in range(1, 6):

                    ans.append(s[j:j+k])

    ansset = sorted(list(set(ans)))

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

l = int(eval(input()))

char = []

if len(s) == 1:

    print(s)

else:

    for i in range(len(s)):

        char.append(s[i])

    charset = sorted(list(set(char)))

    ans = []

    for i in charset:

        if len(set(ans)) > 5:

            break

        for j in range(len(s)):

            if i == s[j]:

                for k in range(1, 6):

                    ans.append(s[j:j+k])

    ansset = sorted(list(set(ans)))

    print((ansset[l-1]))
s = eval(input())
l = int(eval(input()))
char = []
if len(s) == 1:
    print(s)
else:
    for i in range(len(s)):
        char.append(s[i])
    charset = set(char)
    ans = []
    for i in charset:
        for j in range(len(s)):
            if i == s[j]:
                for k in range(1, 6):
                    ans.append(s[j : j + k])
    ansset = sorted(list(set(ans)))
    print((ansset[l - 1]))

s = eval(input())
l = int(eval(input()))
char = []
if len(s) == 1:
    print(s)
else:
    for i in range(len(s)):
        char.append(s[i])
    charset = sorted(list(set(char)))
    ans = []
    for i in charset:
        if len(set(ans)) > 5:
            break
        for j in range(len(s)):
            if i == s[j]:
                for k in range(1, 6):
                    ans.append(s[j : j + k])
    ansset = sorted(list(set(ans)))
    print((ansset[l - 1]))

-    charset = set(char) +    charset = sorted(list(set(char))) +        if len(set(ans)) > 5: +            break