#include <iostream>
#include <cstdlib>
#include <string>
#include <math.h>
#include <vector>

using namespace std;



int rev ( int x )
{
    int res = 0;
    res += ( x % 10 ) * 100;
    x /= 10;
    res += ( x % 10 ) * 10;
    x /= 10; 
    res += ( x % 10 );
    return res;
}

int main ( void )
{
    int a, b;
    cin >> a >> b;
    int a1, b1;
    a = rev ( a );
    b = rev ( b );
    
    if ( a > b ) cout << a << endl;
    else cout << b << endl;
    
     //system ( "pause" );
     return 0;
}
     
