#include <bits/stdc++.h>
using namespace std;
int n, nw;
char tmp[128];
string forb[128];
char w[128];
char l[16];
bool change[128];
char lucky;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", tmp);
    forb[i] = tmp;
    for (int j = 0; j < (int)forb[i].size(); j++)
      forb[i][j] = toupper(forb[i][j]);
  }
  scanf("%s", w);
  string sw = w;
  scanf("%s", l);
  lucky = l[0];
  nw = strlen(w);
  for (int i = 0; i < (int)sw.size(); i++) sw[i] = toupper(sw[i]);
  memset(change, false, sizeof(change));
  for (int i = 0; i < n; i++) {
    int p = 0;
    while (true) {
      int pos = sw.find(forb[i], p);
      if (pos != -1) {
        for (int j = pos; j < pos + (int)forb[i].size(); j++) change[j] = true;
        p++;
      } else
        break;
    }
  }
  for (int i = 0; i < nw; i++)
    if (!change[i])
      printf("%c", w[i]);
    else {
      if (toupper(w[i]) == toupper(lucky)) {
        if (w[i] >= 'A' and w[i] <= 'Z')
          printf("%c", w[i] == 'A' ? 'B' : 'A');
        else
          printf("%c", w[i] == 'a' ? 'b' : 'a');
      } else {
        if (w[i] >= 'A' and w[i] <= 'Z')
          printf("%c", toupper(lucky));
        else
          printf("%c", tolower(lucky));
      }
    }
  printf("\n");
  return 0;
}
