#include <iostream>
#include <stdio.h>
#include <ctype.h>
#include <string>
using namespace std;
 
int main (){
 
//変数宣言
 
    int i=0,j=0;
    string temp;
 
    getline(cin,temp);
  
    for(i=0;i<temp.size();i++){
	if (islower(temp[i])){
	    temp[i] = toupper(temp[i]);
	}else{
	    temp[i] = tolower(temp[i]);
	}
    }
    
//出力
    cout << temp << endl;
    return 0;
}