#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a, b;
    cin >> a >> b;
    vector<int> na(10);
    vector<int> nb(10);
    vector<int> razl(20);
    int i = 0;
    while(a > 0){
        na[i] = a % 10;
        a /= 10;
        i++;
    }
    i--;
    int j = 0;
    while(b > 0){
        nb[j] = b % 10;
        b /= 10;
        j++;
    }
    j--;
    int br = 0;
    if(i > j)
        br = i;
    else
        br = j;
    for(int p = 0; p <= br; p++){
        if(na[p] > nb[p])
            razl[p] = na[p];
        else if(na[p] < nb[p])
            razl[p] = nb[p];
        else 
            razl[p] = na[p]*10 + na[p];

        
    }
    for(int k = br; k >= 0; k--){
        cout<<razl[k];
    }
    cout<<endl;
    
    
    return 0;
}