#include <iostream>
using namespace std;
int main() {
  int x,y,ox,oy,n,k;
  n=0;
  k=1;
  cin>>x>>y;
  while(x!=0||y!=0){
    ox=x%10;
    oy=y%10;
    if(x==0){
      ox=-1;
    }
    if(y==0){
      oy=-1;
    }
    x=x/10;
    y=y/10;
    if(ox>oy){
      n=n+ox*k;
    }
    else if(ox==oy){
      n=n+ox*k;
      k=k*10;
      n=n+oy*k;
    }
    else{
      n=n+oy*k;
    }
    k=k*10;
  }
  cout<<n;
}