#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int a, b, ba = 0, bb = 0;
  vector<int> va, vb, rez(20);
  cin >> a;
  cin >> b;
  while (a) {
    va.push_back(a % 10);
    a /= 10;
    ba++;
  }
  while (b) {
    vb.push_back(b % 10);
    b /= 10;
    bb++;
  }
  if (ba > bb) {
    for (int i = bb; i < ba; i++)
      vb[i] = -1;
  }
  if (bb > ba) {
    for (int i = ba; i < bb; i++)
      va[i] = -1;
  }
  int max = ba;
  if (bb > max) max = bb;
  int j = 0;
  for (int i = 0; i < max; i++) {
    if (va[i] > vb[i]) {
      rez[j] = va[i];
    }
    if (vb[i] > va[i]) {
      rez[j] = vb[i];
    }
    if (va[i] == vb[i]) {
      rez[j] = va[i];
      j++;
      rez[j] = vb[i];
    }
      j++;
  }
  for(int i = j-1; i >= 0; i--) cout << rez[i];
}