#include<cstdio>

using namespace std;

int main(void){
	int i;
	char ch[10000];

	for(i=0;;i++){
		scanf("%c",&ch[i]);
		if(ch[i]=='\n')
			break;
		if('a'<=ch[i] && ch[i]<='z')
			ch[i]-='a'-'A';
		else if('A'<=ch[i] && ch[i]<='Z')
			ch[i]+='a'-'A';
	}

	printf("%s",ch);

	return 0;
}