#include <iostream>
#include <string>

using namespace std;

void solve()
{
	string Red;
	while(cin >> Red, Red != "-")
	{
		string Green, Bottom;
		cin >> Green >> Bottom;
		int R_pos = 0;
		int G_pos = 0;
		int pos = 0;
		char Center = Green[0];
		G_pos++;
		int size = Red.size() + Green.size();
		for(int i = 0; i < size; ++i)
		{
			if(Center == Bottom[pos])
			{
				Center = Red[R_pos];
				R_pos++;
				pos++;
			}
			else
			{
				cout << Center;
				Center = Green[G_pos];
				G_pos++;
			}
		}
		cout << endl;
	}
}

int main()
{
	solve();
	return(0);
}