#include <iostream>
#include <vector>
#include <utility>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string.h>
#include <deque>
#define REP(i,j,n) for(int i=j;i<n;i++)
#define SORT(x) sort(x.begin(),x.end())

using namespace std;



int main() {
	char v[200];
	fgets(v, 200, stdin);
	REP(i, 0, strlen(v)) {
		if (65 <= v[i] && v[i] <= 91) v[i] += 'a' - 'A';
		else if(92<=v[i] && v[i]<=118) v[i] -= 'a' - 'A';
		cout << v[i];
	}
	cout << endl;


	return 0;
}