|All-time Popular Problems|
|Construct Tree from Inorder & Preorder|
|Sum of two large numbers|
|Level order traversal in spiral form|
|Spirally traversing a matrix|
|Angle between hour and minute hand|
|Binary Tree to DLL|
|Smallest Positive missing number|
|Height of Binary Tree|
|Largest Number formed from an Array|
Given a string of length N, print a pattern of strings with first line being the given string of length n and keep priting in new line the strings in decreasing order of length till you print the single first character of the given string.
Input: First line of the input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case consist of only one line which contains a string of length N.
Output: Corresponding to each test case, pattern is printed in a new line.
1 <=T<= 30