#include <iostream>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);


    int X,Y,x,y,t,z,A,B,C,D,E,F,G,H,J,K,L,M;
    cin>>X>>Y;
    X%10==x;
    X-x*10==t;
    Y%10==y;
    Y-y*10==z;
    if( x>y && t>z ){
        x*10 + t == A;
        cout<<A<<endl;
    }else if(x>y && t==z ){
        x*100 + y*10 + t == B;
        cout<<B<<endl;
    } else if(x>y && t<z ){
        x*100 + t*10 + z == C;
        cout<<C<<endl;
    } else if(x=y && t>z){
        x*1000 + y*100 + t*10 + z == D; 
        cout<<D<<endl;
    } else if(x==y && t==z){
        y*100 + t*10 + z == E;
        cout<<E<<endl;
    } else if(x==y && t<z){
        x*100 + y*10 + z == F;
        cout<<F<<endl;
        
    } else if(x<y && t>z ){
        y*10 + t == G;
        cout<<G<<endl;
    } else if(x<y && t==z ){
        y*100 + t*10 + z == H;
        cout<<H<<endl;
    } else if(x<y && t<z){
        y*10 + z == J; 
        cout<<D<<endl;
    }
    
   
    
    return 0;
}