As we defined in problem E. A prefix of a string S is S0,i, similarly, a suffix of a string S is Si,|s|-1.
If a substring of S is both a prefix and suffix, we defined the substring is a presuffix. Now give you a string S, please print all presuffix.
As we defined in problem E. A prefix of a string S is S0,i, similarly, a suffix of a string S is Si,|s|-1.
If a substring of S is both a prefix and suffix, we defined the substring is a presuffix. Now give you a string S, please print all presuffix.
The first line will be an integer T, which is the number of test cases. (1 <= T <= 10)
For each test case, there will be a line with an integer n, which is the length of the string.
Then there is a line with a string S. |S| <= 100000.
S will only contain lower case English letters.
Several lines for each test case. All presuffix of S. And each presuffix should in a single line.
There is en empty line between each test case (Including the last test case).
Print all presuffix by their length in ascending order.
2
5
abaab
5
aaaaa
ab
abaab
a
aa
aaa
aaaa
aaaaa
Bonus problem