#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <iostream>
#include <set>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define PRIME1 99999883
#define PRIME2 99999893
#define EPS 0.00000001
using namespace std;

char RED[55],GREEN[55],ANS[55];

void func(){
	scanf("%s",GREEN);
	scanf("%s",ANS);

	queue<char> Q_R,Q_G,Q_OUT;

	int count = 0;

	for(int i = 0; RED[i] != '\0'; i++){
		Q_R.push(RED[i]);
		count++;
	}

	for(int i = 0; GREEN[i] != '\0';i++){
		Q_G.push(GREEN[i]);
		count++;
	}

	count++;

	int ans_index = 0,work_count = 0;
	char current;

	while(work_count < count){

		if(work_count == 0){
			current = Q_G.front();
			Q_G.pop();

		}else if(work_count == count-1){
			Q_OUT.push(current);
		}else{
			if(current == ANS[ans_index]){
				//push_down
				ans_index++;
				if(!Q_R.empty()){
					current = Q_R.front();
					Q_R.pop();
				}else{
					current = Q_G.front();
					Q_G.pop();
				}
			}else{
				//push_right
				Q_OUT.push(current);
				if(!Q_G.empty()){
					current = Q_G.front();
					Q_G.pop();
				}else{
					current = Q_R.front();
					Q_R.pop();
				}
			}
		}
		work_count++;
	}

	while(!Q_OUT.empty()){
		printf("%c",Q_OUT.front());
		Q_OUT.pop();
	}
	printf("\n");
}

int main(){

	while(true){
		scanf("%s",RED);
		if(RED[0] == '-')break;

		func();
	}

    return 0;
}