Crazy String
Submissions: 1013   Accuracy:

35.22%

  Difficulty: Basic   Marks: 1

You have given a non-empty string. This string consists of lowercase or uppercase or both English letters. The length of the string will not exceed 1000.

Convert the string using following cases:

Case 1: If first character of string is in lowercase then second character should be in uppercase, third character should be in lowercase and so on till the last character of the string.

   For example :   Input   geeksforgeeks

                            Output   gEeKsFoRgEeKs

Case 2: If first character of string is in uppercase then second character should be in lowercase, third character should be in uppercase and so on till the last character of the string.

  For example :   Input    Geeksforgeeks

                           Output   GeEkSfOrGeEkS

Input 

       •   The first line of the input contains a single integer T denoting the number of test cases. 

  • The first line of each test case contains a string. 

Output 

  • For each test case, output the require string in newline. 

 

Constraints 

    •    1 ≤ T ≤ 100
 

Example 

Input: 

2

geeksforgeeks

Geeksforgeeks

 

Output: 

gEeKsFoRgEeKs

GeEkSfOrGeEkS

 

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

Contributor: CHANDRAKANT
Author: TheRed_Viper


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.