#include <iostream>
using namespace std;
int Reverse(int num)
{
int a = 0, b = 0, c = 0;
a = num / 100;
b = (num % 100) / 10;
c = (num % 100) % 10;
return c * 100 + b * 10 + a;
}
int main()
{
int num1, num2;
int result = 0;
cin >> num1 >> num2;
if (Reverse(num1) > Reverse(num2))
result = Reverse(num1);
else
result = Reverse(num2);
cout << result << '\n';
return 0;
}