#include <bits/stdc++.h>
using namespace std;
int k;
char bad[128][128];
char s[128], aux[128];
char letra;
bool muda[128];
inline char toupper(char c) {
  if ('A' <= c and c <= 'Z') return c;
  return c - 'a' + 'A';
}
inline char tolower(char c) {
  if ('a' <= c and c <= 'z') return c;
  return c - 'A' + 'a';
}
inline bool ehlower(char c) { return 'a' <= c and c <= 'z'; }
bool prefx(char *s1, char *s2) {
  for (int i = 0; s1[i] != '\0'; i++)
    if (toupper(s2[i]) != toupper(s1[i])) return false;
  return true;
}
int main() {
  scanf("%d", &k);
  for (int i = 0; i < k; i++) scanf("%s", bad[i]);
  scanf("%s", s);
  scanf("%s", aux);
  letra = aux[0];
  int n = strlen(s);
  memset(muda, false, n * sizeof(bool));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++)
      if (prefx(bad[j], s + i)) {
        int tb = strlen(bad[j]);
        for (int q = i; q < (i + tb < n ? i + tb : n); q++) muda[q] = true;
      }
  }
  for (int i = 0; i < n; i++) {
    if (!muda[i])
      printf("%c", s[i]);
    else {
      if (toupper(s[i]) == toupper(letra)) {
        char muda = toupper(letra) == 'A' ? 'B' : 'A';
        if (ehlower(s[i]))
          printf("%c", tolower(muda));
        else
          printf("%c", toupper(muda));
        continue;
      }
      if (ehlower(s[i]))
        printf("%c", tolower(letra));
      else
        printf("%c", toupper(letra));
    }
  }
  printf("\n");
  return 0;
}
