import std.stdio;
import std.c.stdio;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.regex;
import std.typecons;
 
void main() {
    string[2] I;
    string O;

    bool input() {
        I[0] = readln.chomp;
        if (I[0] == "-") return false;
        I[1] = readln.chomp;
        O = readln.chomp;
        return true;
    }
    
    void solve() {
        int[2] x = [0, 0];
        int c = 1;
        string Ans;
        int i = 0;
        while (true) {
            //writeln(i, " ", x, " ", c, " ", Ans);
            if (i < O.length && O[i] == I[c][x[c]]) {
                x[c]++;
                c = 0;
                i++;
            } else {
                Ans ~= I[c][x[c]];
                x[c]++;
                c = 1;
            }
            if (x[0] == I[0].length && x[1] == I[1].length) break;
        }
        writeln(Ans);
    }

    while (input) solve;
}