#include <iostream>
#include <string>
#include <cmath>

using namespace std;

int main() {
    long int x,y,br=10;
    cin>>x>>y;
    string jes;
    long int br2=max(x,y);
    int x2=log10(br2)+1;
    string resenje[x2+1];
    for(int i=0;i<x2;i++)
    {
      if(x%br != y%br){
        resenje[i]=to_string(max((x%10),(y%10)));
      }
      else{
        resenje[i]=to_string(x%10)+to_string(y%10);
      }
      x/=10;y/=10;
    }
    for(int i=0;i<x2+2;i++)
    {
        jes+=resenje[x2-i+1];
    }
    cout<<jes;
}