"use strict";
main(require("fs").readFileSync("/dev/stdin", "utf8").replace(/\r?\n$/, "").split(/\r?\n/));

function main(lines){
	console.log(lines[0].replace(/[A-Za-z]/g, function(c){return c<="Z"?c.toLowerCase():c.toUpperCase()}));
}