#include <bits/stdc++.h>
using namespace std;

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 100000

typedef long long LL;
typedef long double LD;

int main(){
  string s,t;
  cin >> s >> t;
  int n=s.length(),m=t.length();
  vector<pair<int,int>> spos(n+2),tpos(m+2);
  spos[n]=spos[n+1]={n,n},tpos[m]=tpos[m+1]={m,m};
  for(int i=n-1;i>=0;i--){
    if(s[i]=='0'){
      spos[i]={i,spos[i+1].second};
    }else{
      spos[i]={spos[i+1].first,i};
    }
  }
  for(int i=m-1;i>=0;i--){
    if(t[i]=='0'){
      tpos[i]={i,tpos[i+1].second};
    }else{
      tpos[i]={tpos[i+1].first,i};
    }
  }
  vector<vector<pair<pair<int,int>,pair<int,int>>>> dp(n+2,vector<pair<pair<int,int>,pair<int,int>>>(m+2,{{INF,0},{-1,-1}}));
  dp[n+1][m+1]={{0,0},{n+1,m+1}};
  for(int i=n+1;i>=0;i--){
    for(int j=m+1;j>=0;j--){
      if(i==n+1&&j==m+1) continue;
      if(dp[spos[i].first+1][tpos[j].first+1].first.first<=dp[spos[i].second+1][tpos[j].second+1].first.first){
        dp[i][j]={{dp[spos[i].first+1][tpos[j].first+1].first.first+1,0},{spos[i].first+1,tpos[j].first+1}};
      }else{
        dp[i][j]={{dp[spos[i].second+1][tpos[j].second+1].first.first+1,1},{spos[i].second+1,tpos[j].second+1}};
      }
    }
  }
  string ans="";
  pair<int,int> now={0,0};
  while(now.first!=n+1||now.second!=m+1){
    ans+=(dp[now.first][now.second].first.second+'0');
    now=dp[now.first][now.second].second;
  }
  cout << ans << endl;
  return 0;
}

