Puchi and Ghissi are playing a game with strings. As Ghissi is a champion at strings, Puchi decides to challenge her.
He gives Ghissi a string S and an integer K . The objective for Ghissi is to find a substring of S such that:
- The substring occurs at the start of the string S.
- The substring occurs at the end of the string S.
- The substring also occurs somewhere in the middle of the string S but should not be a prefix of S and it should end on or before position K (1-Based Index).
In other words, this substring should not start from the beginning of the string and must end on or before the position K.
Help Ghissi win the game by finding the largest possible substring.
INPUT
First line contains an integer T. T test cases follow.
Each test case contains a string S of lowercase alphabets ( [a-z] ) and an integer K separated by a space.
OUTPUT
Print the largest possible substring that satisfies the given criteria.
If such a substring does not exist, print "Puchi is a cheat!" without the quotes.
CONSTRAINTS
1<=T<=10
1<=|S|<=106
1<=K<=|S|
S contains only lowercase alphabets [a-z]