#include <iostream>
#include <math.h>
const int reverseNumber(const int Number)
{
int num = Number;
int digits = log10(Number);
int result = 0;
for (size_t i = digits; num != 0; i--)
{
result += (num % 10) * (pow(10, i));
num /= 10;
}
return result;
}
int main(void)
{
std::cin.tie(NULL);
std::cout.tie(NULL);
std::ios::sync_with_stdio(false);
int A, B;
std::cin >> A >> B;
A = reverseNumber(A);
B = reverseNumber(B);
int result = (A > B) ? A : B;
std::cout << result << "\n";
return 0;
}