#arc097a. [arc097_a]K-th Substring

[arc097_a]K-th Substring

Problem Statement

You are given a string ss. Among the different substrings of ss, print the KK-th lexicographically smallest one.

A substring of ss is a string obtained by taking out a non-empty contiguous part in ss. For example, if ss \= ababc, a, bab and ababc are substrings of ss, while ac, z and an empty string are not. Also, we say that substrings are different when they are different as strings.

Let X=x1x2...xnX = x_{1}x_{2}...x_{n} and Y=y1y2...ymY = y_{1}y_{2}...y_{m} be two distinct strings. XX is lexicographically larger than YY if and only if YY is a prefix of XX or xj>yjx_{j} > y_{j} where jj is the smallest integer such that xjneqyjx_{j} \\neq y_{j}.

Constraints

  • 11 s|s| 50005000
  • ss consists of lowercase English letters.
  • 11 KK 55
  • ss has at least KK different substrings.

Partial Score

  • 200200 points will be awarded as a partial score for passing the test set satisfying s|s| 5050.

Input

Input is given from Standard Input in the following format:

ss KK

Output

Print the KK-th lexicographically smallest substring of KK.


Sample Input 1

aba
4

Sample Output 1

b

ss has five substrings: a, b, ab, ba and aba. Among them, we should print the fourth smallest one, b. Note that we do not count a twice.


Sample Input 2

atcoderandatcodeer
5

Sample Output 2

andat

Sample Input 3

z
1

Sample Output 3

z