# -*- coding: utf-8 -*-



# AtCoder Beginner Contest

# Problem C



if __name__ == '__main__':

    s = eval(input())

    k = int(eval(input()))

    extracted = list()

    s_len = len(s)



    for i in range(1, min(k, s_len) + 1):

        start = 0

        ended = i



        for j in range(s_len - i + 1):

            sub_str = s[start:ended]



            if sub_str not in extracted:

                extracted.append(sub_str)



            start += 1

            ended += 1



    sorted_extracted = sorted(extracted)

    print((sorted_extracted[k - 1]))

# -*- coding: utf-8 -*-



# AtCoder Beginner Contest

# Problem C



if __name__ == '__main__':

    s = eval(input())

    k = int(eval(input()))

    extracted = set()

    s_len = len(s)



    # See:

    # https://beta.atcoder.jp/contests/abc097/submissions/2497319

    for i in range(1, min(k, s_len) + 1):

        for j in range(s_len - i + 1):

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



    print((sorted(extracted)[k - 1]))

# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem C
if __name__ == "__main__":
    s = eval(input())
    k = int(eval(input()))
    extracted = list()
    s_len = len(s)
    for i in range(1, min(k, s_len) + 1):
        start = 0
        ended = i
        for j in range(s_len - i + 1):
            sub_str = s[start:ended]
            if sub_str not in extracted:
                extracted.append(sub_str)
            start += 1
            ended += 1
    sorted_extracted = sorted(extracted)
    print((sorted_extracted[k - 1]))

# -*- coding: utf-8 -*-
# AtCoder Beginner Contest
# Problem C
if __name__ == "__main__":
    s = eval(input())
    k = int(eval(input()))
    extracted = set()
    s_len = len(s)
    # See:
    # https://beta.atcoder.jp/contests/abc097/submissions/2497319
    for i in range(1, min(k, s_len) + 1):
        for j in range(s_len - i + 1):
            extracted.add(s[j : i + j])
    print((sorted(extracted)[k - 1]))

-    extracted = list() +    extracted = set() +    # See: +    # https://beta.atcoder.jp/contests/abc097/submissions/2497319 -        start = 0 -        ended = i -            sub_str = s[start:ended] -            if sub_str not in extracted: -                extracted.append(sub_str) -            start += 1 -            ended += 1 -    sorted_extracted = sorted(extracted) -    print((sorted_extracted[k - 1])) +            extracted.add(s[j : i + j]) +    print((sorted(extracted)[k - 1]))