#include <iostream>
#include <string>
using namespace std;

int main() {

  string input,ans;
  getline( cin, input );

  for ( int i = 0; i < input.size(); i++ ) {

    char c = input[i];

    if ( c >= 'a' && c <= 'z' ) {
      c += 'A' - 'a';
    }else if ( c >= 'A' && c <= 'Z' ) {
      c += 'a' - 'A';
    }
    ans += c;

  }

  cout << ans << endl;

  return 0;

}