The grand festival of lights, “Diwali” was round the corner. The festival welcomes Lord Ganesha and Goddess Lakshmi making it imperative for the people to clean the houses and decorate them with lights, Rangolis, Diyas and candles.
Mrs. Joshi busy with her official work asked his son Mayank to make necessary arrangements for Rangoli as she would not be able to make them herself this time. Mayank being well-versed with computer programming language decided to use his programming skills to devise patterns for Rangoli and a similar task of making patterns is now up to you….
You have to input a string (a single word) and use it in the Rangoli.
Note: Kindly use your own IDE to check your code before submitting, rather providing custom input here to check for this question as the pattern which this site generates becomes irregular when compared with the assumed output.
Input Format:
First line contains the T number of test cases. Each of the next T lines contains the string to be inputted in UPPERCASE only. The length of the inputted string should not be greater than ‘7’ . If greater then display "invalid string".
Output Format:
Output the required pattern for each test-case T, checking also the length constraint for the string as specified above. (Observe the sample output carefully and print accordingly)
Sample Input:
Sample Output:
Test Case 1#
Prints the required pattern for the string input 'AGENT' with length=5.
In the resulting pattern the outer boundary shown with numbers remain fixed, the thing that varies is the size of diamond inside as per the input given.
Test Case 2#
It prints 'invalid string' as the length of the inputted string was greater than 7.