s=list(eval(input()))

words=[]

for i in range(len(s)):words.append("".join(s[i:]))

words=sorted(words)



record=[]

k=int(eval(input()))

for i in words:

    for j in range(len(i)):

        if "".join(i[:j+1]) not in record:

            record.append("".join(i[:j+1]))

    if len(record)>=k:

        print((record[k-1]))

        exit()
s=eval(input())

k=int(eval(input()))



words=[]

for i in range(len(s)):words.append(s[i:])

words.sort()



record=[]

for i in words:

    for j in range(len(i)):

        word="".join(i[:j+1])

        if word not in record:

            record.append(word)

    if len(record)>=k:

        print((record[k-1]))

        exit()
s = list(eval(input()))
words = []
for i in range(len(s)):
    words.append("".join(s[i:]))
words = sorted(words)
record = []
k = int(eval(input()))
for i in words:
    for j in range(len(i)):
        if "".join(i[: j + 1]) not in record:
            record.append("".join(i[: j + 1]))
    if len(record) >= k:
        print((record[k - 1]))
        exit()

s = eval(input())
k = int(eval(input()))
words = []
for i in range(len(s)):
    words.append(s[i:])
words.sort()
record = []
for i in words:
    for j in range(len(i)):
        word = "".join(i[: j + 1])
        if word not in record:
            record.append(word)
    if len(record) >= k:
        print((record[k - 1]))
        exit()

-s = list(eval(input())) +s = eval(input()) +k = int(eval(input())) -    words.append("".join(s[i:])) -words = sorted(words) +    words.append(s[i:]) +words.sort() -k = int(eval(input())) -        if "".join(i[: j + 1]) not in record: -            record.append("".join(i[: j + 1])) +        word = "".join(i[: j + 1]) +        if word not in record: +            record.append(word)