#include <iostream>
#include <stack>
#include <cmath>
using namespace std;
int main()
{
int n;
int d = 0;
int temp = 0;
stack<int> s;
while(cin >> n)
{
if(n == 0)
{
cout << "0";
}
temp = log10(n);
while(n > 0)
{
d = n / pow(10, temp);
s.push(d);
n -= d * pow(10, temp);
temp--;
}
while(!s.empty())
{
cout << s.top();
s.pop();
}
cout << endl;
}
return 0;
}