Go Back
The Chat Pattern (100)
Description

Problem Author: Vipul Raghuvanshi
Its the final year of engineering, Vipul and Yash are best friends since FE. They have a peculiar texting pattern when they chat during some exciting talks. The pattern is all the words should start with uppercase character and also ends with uppercase character following the rule of alternate uppercase and lowercase characters. In case of even word length, the two characters at the centre can have same case (uppercase / lowercase). Yash is thinking of some algorithm to convert all his text messages in the required pattern. Help Yash to write a program for this problem.

Input

The first line of input contain an integer T denoting the number of test cases. Each test case consists of one line, which contains a string S which denotes a text of N words with L characters each.

Output

For each test case, output a single line which contains the text following pattern.

Constraints

T <= 100
3 <= N <= 100
3 <= L <= 60

Example
Copy Input

Input:
2
Bohot Hard
Bohot Zyaada Hard

Output:
BoHoT HarD
BoHoT ZyAAdA HarD

Explanation

Both the output strings are following the required pattern.

Good Bye Batch 15-19
#OneLastTime Contest from Batch of 2015-19 of SIES GST



Announcement
Surprise Problem Added!
Contest is extended by 24 hours!

Problem Tags
adhoc, strings

Supported by our Coding Partner