#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, ll;
char s[N][N];
char ss[N];
char ss2[N];
int d[N];
int nxt[N];
char cmd[10];
void go(char *s) {
  int len = strlen(s);
  nxt[0] = 0;
  nxt[1] = 0;
  int j = 0;
  for (int i = 1; i < len; ++i) {
    while (s[i] != s[j] && j > 0) {
      j = nxt[j];
    }
    if (s[i] == s[j]) j++;
    nxt[i + 1] = j;
  }
  j = 0;
  for (int i = 0; i < ll; ++i) {
    while (ss[i] != s[j] && j > 0) {
      j = nxt[j];
    }
    if (ss[i] == s[j]) {
      j++;
    }
    if (j == len) {
      d[i + 1]--;
      d[i + 1 - len]++;
      j = nxt[j];
    }
  }
}
char chg(char c) { return c <= 'Z' ? (c + 32) : c; }
char chg2(char c) {
  if (c == cmd[0]) return cmd[0] == 'a' ? 'b' : 'a';
  if (c == cmd[0] - 'a' + 'A') return cmd[0] == 'a' ? 'B' : 'A';
  return c <= 'Z' ? (cmd[0] - 'a' + 'A') : cmd[0];
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s[i]);
  }
  scanf("%s", ss);
  scanf("%s", cmd);
  cmd[0] = chg(cmd[0]);
  strcpy(ss2, ss);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; s[i][j] != 0; ++j) {
      s[i][j] = chg(s[i][j]);
    }
  }
  ll = strlen(ss);
  for (int i = 0; i < ll; ++i) {
    ss[i] = chg(ss[i]);
  }
  for (int i = 0; i < n; ++i) {
    go(s[i]);
  }
  for (int i = 1; i <= ll; ++i) {
    d[i] += d[i - 1];
  }
  for (int i = 0; i < ll; ++i) {
    if (d[i] > 0) {
      ss2[i] = chg2(ss2[i]);
    }
  }
  printf("%s\n", ss2);
  return 0;
}
