#include<stdio.h>
#include<string.h>
char R[100000],G[100000],B[100000],A[100000],n;
int r,g,a,b,p;

int main()
{
	for(;gets(R),R[0]!='-';)
	{
		memset(A,0,sizeof(A));
		gets(G);gets(B);
		for(r=a=b=0,n=G[0],g=1;R[r]||G[g];)
		{
			if(n==B[b])
			{
				b++;
				n=R[r++];
			}
			else
			{
				A[a++]=n;
				n=G[g++];
			}
		}
		A[a++]=n;
		puts(A);
	}
	return 0;
}