#include<iostream>
#include<cstdio>
#include<vector>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)

int main() {
  for(;;) {
    string red, green, under;
    cin >> red; if( red == "-" ) break;
    cin >> green >> under;

    string left;
    int r = 0, g = 0;
    int u = 0;

    for(char center = green[g++]; left.size() + under.size() != red.size() + green.size();) {
      if( under[u] == center ) {
        u++;
        center = red[r++];
      } else {
        left += center;
        center = green[g++];
      }
    }
    cout << left << endl;
  }
  return 0;
}