import math, sys

from bisect import bisect_left, bisect_right

from collections import Counter, defaultdict, deque

from copy import deepcopy

from functools import lru_cache

from heapq import heapify, heappop, heappush

from itertools import accumulate, combinations, permutations

input = sys.stdin.readline

mod = 10**9 + 7

ns = lambda: input().strip()

ni = lambda: int(input().strip())

nm = lambda: list(map(int, input().split()))

nl = lambda: list(map(int, input().split()))



def main():

    s = ns()

    k = ni()



    check = set()



    for left in range(0, len(s)):

        for right in range(left+1, left+k+1):

            check.add(s[left:right])

    

    print((sorted(list(check))[k-1]))



if __name__ == '__main__':

    main()
import math, sys

from bisect import bisect_left, bisect_right

from collections import Counter, defaultdict, deque

from copy import deepcopy

from functools import lru_cache

from heapq import heapify, heappop, heappush

from itertools import accumulate, combinations, permutations

input = sys.stdin.readline

mod = 10**9 + 7

ns = lambda: input().strip()

ni = lambda: int(input().strip())

nm = lambda: list(map(int, input().split()))

nl = lambda: list(map(int, input().split()))





s = ns()

k = ni()



check = set()



for left in range(0, len(s)):

    for right in range(left+1, left+k+1):

        check.add(s[left:right])



print((sorted(list(check))[k-1]))



import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations

input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))


def main():
    s = ns()
    k = ni()
    check = set()
    for left in range(0, len(s)):
        for right in range(left + 1, left + k + 1):
            check.add(s[left:right])
    print((sorted(list(check))[k - 1]))


if __name__ == "__main__":
    main()

import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations

input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: list(map(int, input().split()))
nl = lambda: list(map(int, input().split()))
s = ns()
k = ni()
check = set()
for left in range(0, len(s)):
    for right in range(left + 1, left + k + 1):
        check.add(s[left:right])
print((sorted(list(check))[k - 1]))

- - -def main(): -    s = ns() -    k = ni() -    check = set() -    for left in range(0, len(s)): -        for right in range(left + 1, left + k + 1): -            check.add(s[left:right]) -    print((sorted(list(check))[k - 1])) - - -if __name__ == "__main__": -    main() +s = ns() +k = ni() +check = set() +for left in range(0, len(s)): +    for right in range(left + 1, left + k + 1): +        check.add(s[left:right]) +print((sorted(list(check))[k - 1]))