#include <bits/stdc++.h>
using namespace std;
char dd[200][200], s[200], pp, k1, k2;
int vis[200];
char change(char p1) {
  char p2;
  if (p1 >= 'A' && p1 <= 'Z')
    p2 = p1 - 'A' + 'a';
  else
    p2 = p1;
  return p2;
}
int main() {
  int n, m1, m2;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%s", dd[i]);
  scanf("%s", s);
  getchar();
  scanf("%c", &pp);
  m1 = strlen(s);
  for (int i = 1; i <= n; i++) {
    m2 = strlen(dd[i]);
    for (int j = 0; j <= m1 - m2; j++) {
      int k;
      for (k = 0; k <= m2 - 1; k++) {
        k1 = change(dd[i][k]);
        k2 = change(s[j + k]);
        if (k1 != k2) break;
      }
      if (k == m2)
        for (int m = 0; m <= m2 - 1; m++) vis[j + m] = 1;
    }
  }
  for (int i = 0; i < m1; i++)
    if (vis[i] == 1 && pp != 'a') {
      if (s[i] == pp)
        s[i] = 'a';
      else if (s[i] - 'A' + 'a' == pp)
        s[i] = 'A';
      else if (s[i] >= 'A' && s[i] <= 'Z')
        s[i] = pp - 'a' + 'A';
      else
        s[i] = pp;
    } else if (vis[i] == 1 && pp == 'a') {
      if (s[i] == pp)
        s[i] = 'b';
      else if (s[i] - 'A' + 'a' == pp)
        s[i] = 'B';
      else if (s[i] >= 'A' && s[i] <= 'Z')
        s[i] = pp - 'a' + 'A';
      else
        s[i] = pp;
    }
  printf("%s\n", s);
}
