#include <stdio.h>
#include <stdlib.h>
int count(int a){
    int br=0;
    while(a!=0){
        br++;
        a/=10;
    }
    return br;
}
int max(int a,int b){
    return a > b ? a : b;
}
int main()
{
    int x,y,z,k=0;
    scanf("%d",&x);
    scanf("%d",&y);
    int xbr=count(x), ybr=count(y), maxbr=max(xbr,ybr);
    int a[xbr],b[ybr],c[xbr+ybr];
    for(int i=0;i<xbr;i++){
        a[i]=x%10;
        x/=10;
    }
    for(int i=0;i<ybr;i++){
        b[i]=y%10;
        y/=10;
    }
    for(int i=0;i<maxbr;i++){
        if(xbr<i+1)
            c[i+k]=b[i];
        else if(ybr<i+1)
            c[i+k]=a[i];
        else{
            if(a[i]>b[i])
                c[i+k]=a[i];
            else
                c[i+k]=b[i];
            if(a[i]==b[i]){
                c[i+k]=a[i];
                c[i+k+1]=b[i];
                k++;
            }}
    }
    x=1;
    for(int i=0;i<maxbr+k;i++){
        z+=c[i]*x;
        x*=10;}
    printf("%d",z);
    return 0;
}