process.stdin.resume();
process.stdin.setEncoding('utf8');

process.stdin.on('data', function (chunk) {
    const n = chunk.toString().replace("\n", "");
    const r = n.split("");
    sp(r);
});

function sp(rep){
    const c = rep.slice().map(x => x.toUpperCase());
    const d = rep.slice();
    const b = rep.slice().map(x => x.toLowerCase());
    var kaeru = [];
    for(var i=0; i<c.length; i++){
        if(c[i]!=d[i]){
            kaeru += c[i];
        }else{
            kaeru += b[i];
        }
    }
    console.log(kaeru);
}
