#include <stdio.h>
#include <stdlib.h>

int power(unsigned long long int broj, int br){
    for (br;br>1;br--){
        broj*=10;
    }
    return broj;
}

int brojac(unsigned long long int broj){
    int br = 0;
    if (broj<10)
        return 1;
    else
        for (br;broj!=0; broj/=10)
            br++;
    return br;
}

void Sudari(unsigned long long int x,unsigned long long int y){
    int Brr = 0;
    int Brx = brojac(x);
    int Bry = brojac(y);
    if (Brx>Bry)
        Brr=Brx-Bry;
    else
        Brr=Bry-Brx;

    printf ("Brx: %d \nBry: %d \nBrr: %d\n\n", Brx, Bry, Brr);           //Brojaci cifara

    if(Brr){
        if (Brx>Bry)
            for(Brr; Brr>0; Brr--){
                printf("%d", (x/power(1,Brx))%10);
                Brx--;
            }
        else
            for(Brr; Brr>0; Brr--){
                printf("%d", (y/power(1,Bry))%10);
                Bry--;
            }
    }

    while (Brx>0){
    int temp1, temp2;
    temp1 = x/power(1,Brx)%10;
    temp2 = y/power(1,Bry)%10;
    if (temp1 == temp2)
        printf("%d%d", temp1, temp2);
    else if (temp1>temp2)
        printf("%d", temp1);
    else
        printf("%d", temp2);
    Brx--;
    Bry--;
    }

}

int main()
{
    unsigned long long int x,y;
    scanf("%d", &x);
    scanf("%d", &y);

    Sudari(x,y);
    return 0;
}