'use strict'

const main = arg => {
    var input = arg.trim().split("\n")[0];
    var result = [];
    [...Array(input.length)].forEach((a, i) => {
        if(input[i].match(/[A-Z]/)){ 
            result.push(input[i].toLowerCase()); 
        } else {
            result.push(input[i].toUpperCase()); 
        } 
    });

    console.log(result.join(""));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
