#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
int ans = 0;
int t1 = n / 100;
int t2 = n /10%10;
int t3 = n % 10;
if(t3 != 0)
{
ans =t3 * 100 + t2 * 10 + t1;
}
else
{
ans = t2 * 10 + t1;
}
cout << ans <<endl;
}