#include<bits/stdc++.h>
using namespace std;
int main(){
string str;
  cin>>str;
  if(str.size()==2){
    cout<<str<<endl;
  }
  else{
   cout<<str.at(2)<<str.at(1)<<str.at(0)<<endl;
  }
  return 0;
}
#include<bits/stdc++.h>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(),(x).end()
#define endl "\n"

using ll = long long;
using P = pair<int,int>;
using mp =  map<string,int>;

const int MOD = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    string s;
    cin >> s;

    if(s.size() == 3) {
        reverse(all(s));
    }

    cout << s << endl;

    return 0;
}

