#include <bits/stdc++.h>
using namespace std;
char c[105][105], cc[105], s[105], ss[105], sss[105], T[5];
void solve() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i <= n - 1; i++) scanf("%s", c[i]);
  scanf("%s", s);
  int l = strlen(s);
  for (int i = 0; i <= l - 1; i++) {
    ss[i] = s[i];
    if (s[i] >= 'A' && s[i] <= 'Z') ss[i] += 32;
    sss[i] = ss[i];
  }
  ss[l] = '\0';
  scanf("%s", T);
  char Cc = 'a';
  if (Cc == T[0]) Cc = 'b';
  for (int i = 0; i <= n - 1; i++) {
    int lc = strlen(c[i]);
    for (int j = 0; j <= lc - 1; j++) {
      cc[j] = c[i][j];
      if (c[i][j] >= 'A' && c[i][j] <= 'Z') cc[j] += 32;
    }
    cc[lc] = '\0';
    for (int j = 0; j <= l - lc; j++) {
      if (cc[0] == ss[j]) {
        bool flag = true;
        for (int k = 0; k <= lc - 1; k++) {
          if (cc[k] != ss[j + k]) {
            flag = false;
            break;
          }
        }
        if (flag) {
          for (int k = 0; k <= lc - 1; k++) {
            if (ss[j + k] != T[0])
              sss[j + k] = T[0];
            else
              sss[j + k] = Cc;
          }
        }
      }
    }
  }
  for (int i = 0; i <= l - 1; i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') {
      if (sss[i] >= 'a' && sss[i] <= 'z') sss[i] -= 32;
    }
  }
  sss[l] = '\0';
  printf("%s\n", sss);
}
int main() {
  solve();
  return 0;
}
