BETA
School Problem's Submission isn't counted in score!

Total Submissions: 1600 Accuracy:

45.06%

Pattern of Strings
       

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.

Constraints:
1 <=T<= 30
N= 5

Example:

Input:
2
Geeks
th%ik

Output:
Geeks
Geek
Gee
Ge
G

th%ik
th%i
th%
th
t

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Vaibhav Tyagi

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.