#include<iostream>
#include<cmath>
#include<math.h>
using namespace std;

int main()
{
	char a,b;
	int c,d;
	cin>>a;
	if(a>=97&&a<=122){
		b=a-32;
		cout<<b;}
	else if(a>=65&&a<=90){
		b=a+32;
		cout<<b;}
	else if(a>=48&&a<=57){
		c=a-'0';
		d=pow(c,2);
		cout<<d;}
	else
		cout<<a;
		
	
	
	return 0;
}
