const input = require('fs').readFileSync('/dev/stdin', 'utf8');
let arr = [...input];
let ans = "";
for (let i = 0; i < arr.length; i++) {
    if (arr[i] === arr[i].toLowerCase()) {
        ans += arr[i].toUpperCase();
    } else {
        ans += arr[i].toLowerCase();
    }
}
console.log(ans.trim());

