#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(x) x.begin(), x.end()
#define dbg(x) cout << (x) << "\n"
#define pf push_front
#define pb push_back
#define mp make_pair
#define f first
#define s second

int veci(int x, int y){
    if(x>y) return x;
    if(y>x || y==x) return y;
}
int main()
{
    int x,y,i=0,j=0,n=0;
    int nizx[10^9],nizy[10^9];
    cin>>x;
    cin>>y;
    int z=0;

    while(x!=0){
        nizx[i++] = x%10;
        x/=10;
    }
    while(y!=0){
        nizy[j++] = y%10;
        y/=10;
    }

    if(i>j || i == j){
        y = j;
        n = i;
    }
    if(j>i){
        n = j;
        y = i;
    }

    j = 1;
    for(i = 0; i < n; i++){
        if(nizx[i]==nizy[i]){
            z += nizx[i]*j + nizy[i]*j*10;
            j*=100;
        }
        else{
            z += veci(nizx[i],nizy[i])*j;
            j*=10;
        }
    }
    dbg(z);
    return 0;
}