Long long ago, there lived a lot of rabbits in the forest. One day, the king of the rabbit kingdom got a mysterious string and he wanted to study this string.
At first, he would divide this string into no more than k substrings. Then for each substring S, he looked at all substrings of S, and selected the one which has the largest dictionary order. Among those substrings selected in the second round, the king then choose one which has the largest dictionary order, and name it as a "magic string".
Now he wanted to figure out how to divide the string so that the dictionary order of that "magic string" is as small as possible.
There are at most 36 test cases.
For each test case, the first line contains a integer k indicating the maximum number of substrings the king could divide, and the second line is the original mysterious string which consisted of only lower letters.
The length of the mysterious string is between 1 and 105 and k is between 1 and the length of the mysterious string, inclusive.
The input ends by k = 0.
For each test case, output the magic string.