#include <iostream>

using namespace std;

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  long long x, y,i;
  string s="";
  long long x1 = 0,y1 = 0;

  cin >> x >> y;

  while (x > 0 || y > 0) {

    //poslednja cifra
    x1 = x % 10;
    y1 = y % 10;

    if (x1 == y1 && x > 0 && y > 0)
      s = s + char('0'+x1) + char('0'+y1);
    else {

      if (x1 > y1)
        s = s + char('0' + x1);
      if (y1 > x1)
        s = s + char('0' + y1);
      if (x1 == y1)
        s = s + char('0' + x1);

    }
  
    x = x / 10;
    y = y / 10;

  }

  int l = s.length();

  //cout << s << '\n';

  for (i = l - 1; i >= 0; i--)
    cout << s[i];

  cout << '\n';


  return 0;
}