#include<iostream>
#include<string>
using namespace std;
int main()
{
string s;
cin >> s;
string::iterator it = s.end();
while (s.back() == '0' && s.begin() != --(it))
{
//string::iterator it = s.end();
//s.erase(--(it));
s.pop_back();
}
if (s[0] != '-')
{
for (int i = s.size() - 1; i >= 0; i--)
{
cout << s[i];
}
cout << endl;
}
else
{
cout << s[0];
for (int i = s.size() - 1; i > 0; i--)
{
cout << s[i];
}
cout << endl;
}
return 0;
}