import std.stdio;
import std.string;

void main(){
  string a,s=readln.chomp;
  for(int i=0;i<s.length;++i){
    if('a'<=s[i]&&s[i]<='z')a~=s[i]-'a'+'A';
    else if('A'<=s[i]&&s[i]<='Z')a~=s[i]-'A'+'a';
    else a~=s[i];
  }
  writeln(a);
}