K. kostka Loves Hashing
time limit per test
5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

At the 2023 Brazilian Summer Camp, prominent Polish coder kostka told his students how hashing is the best thing in the world. It makes problems related to strings that much easier! As such, an easy question related to strings must be made in order to show how efficient it is. The task is quite simple: you are given a string $$$s$$$ and an integer $$$k$$$. You only need to print out how many substrings $$$t$$$ exist, such that $$$(|t| * freq(t) = k)$$$, where $$$freq(t)$$$ is the amount of times the substring appears in the string. If at least one substring fits the criteria, you should print out the lexicographically smallest and the lexicographically largest (note that they may be the same). Quite an easy task, right?

Lexicographical order is defined as follows: when ordering two strings $$$a$$$ and $$$b$$$, $$$a$$$ is lexicographically smaller than $$$b$$$ if and only if one of the following holds:

  • $$$a$$$ is a prefix of $$$b$$$, but $$$a \neq b$$$.
  • in the first position where $$$a$$$ and $$$b$$$ differ, the string $$$a$$$ has a letter that appears earlier in the alphabet than the corresponding letter of $$$b$$$.
Input

The first line of the input contains two integers $$$n$$$ and $$$k$$$, $$$(1 \leq n \leq 10^6)$$$, $$$(1 \leq k \leq 10^{12})$$$ — the length of the string and the desired value.

The second line of the input will contain the string $$$s$$$, containing only lowercase Latin letters.

Output

On the first line, output the amount of substrings that fit the criteria. Then, if substrings exist, print out the lexicographically smallest and then the lexicographically largest.

Examples
Input
6 12
aaaaaa
Output
2
aaa
aaaa
Input
5 3
zhdke
Output
3
dke
zhd
Input
6 20
kostka
Output
0