#include <iostream> #include <stdio.h> using namespace std; #define ll long long int reverse(ll x){ ll y=0; while(x!=0){ y=y*10+x%10; x/=10; } return (y<INT_MIN||y>INT_MAX) ? 0 : y; } int main(){ ll n; cin>>n; cout<<reverse(n)<<endl; return 0; }