"use strict";

function Main(input) {
    var ans="";
    for(var i=0;i<input.length;i++){
        var temp=input.charAt(i);
        if(temp === temp.toLowerCase())
            ans+=temp.toUpperCase();
        else
            ans+=temp.toLowerCase();
    }
    console.log(ans);
}
    
function debug(){
	var input = document.getElementById("input").value;
	Main(input);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));