#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
char s1[200];
int i,j,n;
while(cin.getline(s1,200)){
n=strlen(s1);
if(strcmp(s1,"!")==0)
return 0;
for(i=0;i<n;i++){
if(s1[i]>='A'&&s1[i]<='Z')
s1[i]='A'+'Z'-s1[i];
else if(s1[i]>='a'&&s1[i]<='z')
s1[i]='a'+'z'-s1[i];
}
cout<<s1<<endl;
}
return 0;
}