Codeforces Beta Round 95 (Div. 2)
A
cAPS lOCK
Codeforces
1000
原题
←B →
翻译中…

wHAT DO WE NEED cAPS LOCK FOR?

翻译中…

Caps lock is a computer keyboard key. Pressing it sets an input mode in which typed letters are capital by default. If it is pressed by accident, it leads to accidents like the one we had in the first passage.

翻译中…

Let's consider that a word has been typed with the Caps lock key accidentally switched on, if:

翻译中…
  • either it only contains uppercase letters;
  • or all letters except for the first one are uppercase.
翻译中…

In this case we should automatically change the case of all letters. For example, the case of the letters that form words "hELLO", "HTTP", "z" should be changed.

翻译中…

Write a program that applies the rule mentioned above. If the rule cannot be applied, the program should leave the word unchanged.

翻译中…

Input

翻译中…

The first line of the input data contains a word consisting of uppercase and lowercase Latin letters. The word's length is from 1 to 100 characters, inclusive.

翻译中…

Output

翻译中…

Print the result of the given word's processing.

翻译中…

样例

Input #1
cAPS
Output #1
Caps
InputCopy OutputCopy
Input #2
Lock
Output #2
Lock
InputCopy OutputCopy
题目信息
题号
131A
时间限制
0.5 s
内存限制
256 MB
标签
模拟
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。