// Aizu Vol-10 1036: Monster Factory
// 2017.8.21 bal4u@uu

#include <stdio.h>
char *gets();

#define MAX 10000
char in1[MAX+5], in2[MAX+5], out[MAX+5];

int main()
{
	char k, *i1, *i2, *o;

	while (1) {
		gets(in1); if (in1[0] == '-') break;
		gets(in2), gets(out);
		i1 = in1, i2 = in2, o = out, k = *i2++;
		while (*i1 || *i2) {
			if (*o == k) k = *i1++, o++;
			else {
				putchar(k);
				if (*i2) k = *i2++;
				else goto NEXT;
			}
		}
		putchar(k);
NEXT:;	putchar('\n');
	}
	return 0;
}