#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
  string x, y, z;
  while(cin >> x >> y >> z){

    int p = 0;
    int pred =  0, pgreen = 1;
    char ch = y[0];

    string ret;

    while(p < z.size()){
      if( ch == z[p]){
        ch = x[pred++];
        p++;
      }else{
        ret += ch;
        ch = y[pgreen++];
      }
    }
    ret += ch + y.substr(pgreen);
    cout << ret << endl;
  }
}