fb pixel

Caps lock

When typing an essay the writer didn’t notice that the caps lock was on. So, the whole text was written with a complete opposite casing. All the uppercase letters were actually lowercase and the lowercase ones were uppercase.
Can you help and fix it?
The program receives several lines, which are the contents of the essay. The final line is the phrase The End! (which also has the wrong casing).
The program should print as many lines as the input contains and fix all the casing issues.
Input
dEAR AUDIENCE, 
tHIS ESSAY IS ABOUT aNNA. 
hOPE YOU'LL ENJOY IT!
tHE eND!

Output
Dear audience,
This essay is about Anna.
Hope you'll enjoy it!
The End!
 
To check your solution you need to sign in
Sign in to continue