import std.stdio,
       std.string,
       std.conv,
       std.range,
       std.algorithm,
       std.uni;

void main(){
	string i = readln.chomp;
	string s;
	foreach(c;i){
		if (isLower(c))
			s ~= toUpper(c);
		else
			s ~= toLower(c);
	}
	writeln(s);
}