#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
using namespace std;
string youyi(string s){
for(int i=0;i<s.size();i++){
if(s[i]>'a' && s[i]<'z'){
if(s[i]>='x') s[i]-=23;
else s[i]+=3;
}
else{
if(s[i]>'X') s[i]-=23;
else s[i]+=3;
}
}
return s;
}
string dx(string s){
for(int i=0;i<s.size();i++){
if(s[i]>=97) s[i]-=32;
else s[i]+=32;
}
return s;
}
string fz(string s){
reverse(s.begin(),s.end());
return s;
}
int main(){
string s;
cin>>s;
cout<<dx(fz(youyi(s)))<<endl;
return 0;
}