#include<stdio.h>
#include<string.h>
#include<ctype.h>
int main(void){
  
  while(1){
    char one[200],two[200],three[200];
    int i,j,ans1[200],ans2[200],l[200],len;
    
    for(i=0;i<200;i++){
      ans1[i]=0;
      ans2[i]=0;
      l[i]=0;
    }

   
    scanf("%[^\n]%*c",one);
    if(one[0]=='-')break;
    
    scanf("%[^\n]%*c",two);
    scanf("%[^\n]%*c",three);

    len=max(strlen(one),strlen(two));

     for(i=0;i<len;i++){
      for(j=0;j<len;j++){
	if(three[i]==one[j])l[i]=2;
	else if(three[i]==two[j])l[i]=1;
      }

    }

     /* for(i=0;i<len+1;i++){
	printf("%d ",l[i]);
	printf("%c",two[i]);
}
printf("\n");*/

    for(i=0;isalpha(one[i]);i++){
      for(j=0;isalpha(three[j]);j++)
	if(one[i]==three[j])ans1[i]=1;   
    }

    for(i=0;isalpha(one[i]);i++){
      for(j=0;isalpha(three[j]);j++)
	if(two[i]==three[j])ans2[i]=1;   
    }
    
    int k;
    for(k=0;k<len;k++){
      //printf("%d",l[k]);
      if(l[k]==1){
	for(i=0;isalpha(one[i]);i++){
	  if(ans1[i]==0){
	    printf("%c",one[i]);
	    ans1[i]=1;
	    break;
	  }
	}
      }
      else if(l[k]==2){
	for(j=0;isalpha(two[j]);j++){
	  if(ans2[j]==0){
	    printf("%c",two[j]);
	    ans2[j]=1;
	    break;
	  }
	}
      }
    }
    printf("\n");
  }

  return 0; 
}

int max(int x,int y){
  return (x<y)?y:x;
}