#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){

  char a[201],n=0;
  scanf("%c",&a[0]);
  while(a[n] != '\n'){
    
    if(a[n] >= 'A' && a[n] <= 'Z'){
      a[n] = a[n]-'A'+'a';
    }
    else if(a[n] >= 'a' && a[n] <= 'z'){
      a[n] = a[n]-'a'+'A';
    }
    n++;
    scanf("%c",&a[n]);
  }

  for(int i = 0;i < n;i++){
    printf("%c",a[i]);
  }
  cout << endl;
  return (0);
}