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

using namespace std;

int main() {
  int a, b, ba = 0, bb = 0, rez = 0;
  vector<int> va, vb;
  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, dec = 1;
  if(bb > max) max = bb;
  for(int i = 0; i < max; i++){
    if(va[i] > vb[i]){
      rez += dec * va[i];
    }
    if(vb[i] > va[i]){
      rez += dec * vb[i];
    }
    if(va[i] == vb[i]) {
      rez += dec * vb[i];
      dec *= 10;
      rez += dec * va[i];
    }
    dec *= 10;
  }
  cout << rez;
  //for(int i = 0; i < max; i++) cout << va[i];
  //for(int i = 0; i < max; i++) cout << vb[i];
}