#C37. Taco Case Swapping

    ID: 47155 Type: Default 1000ms 256MiB

Taco Case Swapping

Taco Case Swapping

You are given a word consisting of English alphabetic characters. Your task is to transform the word by swapping the case of each alphabet. In other words, transform each uppercase letter into its corresponding lowercase letter and vice versa.

Formally, for each character c in the word, the transformation is defined as follows:

$$ f(c) = \begin{cases} \text{lower}(c) & \text{if } c \text{ is uppercase}\\ \text{upper}(c) & \text{if } c \text{ is lowercase} \end{cases} $$

You will be given multiple test cases. For each test case, output the transformed word on a new line.

inputFormat

The first line of the input contains a single integer T, representing the number of test cases. Each of the following T lines contains a word composed of alphabetic characters only.

outputFormat

For each test case, output the transformed word, where each letter’s case has been swapped. Print each result on a new line.## sample

3
HelloWorld
JavaProgramming
SWAPcase
hELLOwORLD

jAVApROGRAMMING swapCASE

</p>