include <bits/stdc++.h>
include
include
using namespace std;
int main() {
string s;
getline(cin, s);
for(char &c : s){
if(isupper(c)){
c = tolower(c);
}else if(islower(c)){
c = toupper(c);
}
}
reverse(s.begin(), s.end());
cout << s;
return 0;
}