#include <bits/stdc++.h>

using namespace std;

int main()
{

int a, b; cin >> a >> b;
int za=a; int zb=b;
int bra=0, brb=0;
int aa[10];
int bb[10];
int br;
int a1, b1;
while(za>0) {
    za=za/10;
    bra++;
}
while(zb>0) {
    zb=zb/10;
    brb++;
}


for(int i = 0; i<bra; i++){
    a1=
    aa[i]=a%10;
    a=a/10;
    
}
for(int i = 0; i<brb; i++){
    
    bb[i]=b%10;
    b=b/10;
}
if(bra>brb) br=bra;
else br=brb;

for(int i = br-1; i>=0; i--){
 if(i > bra-1 ) cout << bb[i];
 else  if(i > brb-1 ) cout << aa[i];
    
    else if(aa[i]>bb[i]) cout << aa[i];
    else if(aa[i]<bb[i]) cout << bb[i];
    else if(aa[i]==bb[i]) cout << aa[i] << bb[i];

}




    return 0; 
}