#include <iostream>
#include <cstdlib>
#include <string>

using namespace std;

int main(void)
{
    string a; int x;
    string b; int y;
    string swap;
    
    cin >> a >> b;
    
    swap[0] = a[0];
    a[0] = a[2];
    a[2] = swap[0];
    
    swap[0] = b[0];
    b[0] = b[2];
    b[2] = swap[0];
    
    x = atoi(a.c_str());
    y = atoi(b.c_str());
    
    if(x > y)
        cout << a;
    else
        cout << b;
    
    return 0;
}
