Given an odd length word your task is to complete the function printPattern that takes a string s as its argument and prints it from the middle of the word such that it follows the following pattern.
Input: PROGRAM Input: RAT
The above is proper shaped pattern for the test case, but when
printed in a single line it becomes as shown in the output.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consists of a single line containing an odd length string s.
Corresponding to each test case in a new line print the pattern in a single line where each row of the pattern is separated by a "$" instead of a new line.
1 ≤ T ≤ 20
1<=size of string(s)<=20
Example(To be used only for expected ouput): Input