#P2199. Longestsubstring

Longestsubstring

    Given a string S0S… SL-1SLSL+1 … S2L-1,the different value means the number of different characters between S0S… SL-1 and SLSL+1 … S2L-1, when compare them from left to right. For example, different value of abcaec is 1,because only the second character is different between abc and aec.

    Now,given a string, you should find out that whether it contains a substring of even length, of which the different value is not bigger than a given value D. If you can find more than one substrings matching condition, please output the longest one. If more than one substrings of same length match condition, please output the one nearest from the left end.

<o:p></o:p>

Input

The first line of input contains an integer representing the number of test cases.
Each test case consists of an integer D(D>=0)and a string (the length is no more than 2000). The string is composed of lowercase letters.

Output

For each test case, if you can find one substring, print the longest substring and its length, otherwise print "Not found" in a line.

Sample Input

3
1 f
0 kjjjgieie
0 abcd

Sample Output

Not found
4 ieie
Not found

HINT

Source