#include<iostream>
#include<string>
using namespace std;
void main()
{
int i;
string str;
cin >> str;
for(i=0;i<str.length();i++)
{
//大写转小写
if(str[i]>='A'&&str[i]<='Z')
{
str[i] += 32;
continue;
}
//小写转大写
if(str[i]>='a'&&str[i]<='z')
{
str[i] -= 32;
continue;
}
}
cout << str;
}