#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef set<char> SET;

int main() {
    string a, b, c;
    while ( cin >> a && a != "-" ) {
        cin >> b >> c;

        int na = a.size(), nb = b.size(), nc = c.size();
        string res;
        char t = b[0];
        for ( int i = 0, j = 1, k = 0; i < na || j < nb; ) {
            if ( k < nc && c[k] == t ) {
                k ++;
                t = a[i++];
            } else {
                res += t;
                t = b[j++];
            }
        }
        res += t;
        cout << res << endl;
    }
    return 0;
}