#include <bits/stdc++.h>
char str[101];
int lstr;
char forb[100][101];
int length[100];
char upper[101];
char replace[101];
char hockey[101];
int lhockey;
int N;
int main() {
  while (scanf("%d", &N) == 1) {
    int i, j, k;
    for (i = 0; i < N; i++) {
      scanf(" %s", forb[i]);
      length[i] = strlen(forb[i]);
      for (j = 0; j < length[i]; j++) {
        forb[i][j] = tolower(forb[i][j]);
      }
    }
    scanf(" %s", str);
    lstr = strlen(str);
    for (j = 0; j < lstr; j++) {
      upper[j] = isupper(str[j]);
      str[j] = tolower(str[j]);
    }
    scanf(" %s", hockey);
    lhockey = strlen(hockey);
    for (j = 0; j < lhockey; j++) {
      hockey[j] = tolower(hockey[j]);
    }
    memset(replace, 0, sizeof(replace));
    for (k = 0; k < N; k++) {
      for (i = 0; i < lstr; i++) {
        char flag = 1;
        for (j = 0; flag && j < length[k] && i + j < lstr; j++) {
          flag = forb[k][j] == str[i + j];
        }
        if (flag && j == length[k]) {
          for (j = 0; j < length[k]; j++) {
            replace[i + j] = 1;
          }
        }
      }
    }
    for (i = 0; i < lstr; i++) {
      if (replace[i]) {
        str[i] = str[i] == hockey[0] ? hockey[0] == 'a' ? 'b' : 'a' : hockey[0];
      }
    }
    for (i = 0; i < lstr; i++) {
      if (upper[i]) {
        str[i] = toupper(str[i]);
      }
    }
    printf("%s\n", str);
  }
  return 0;
}
