#include <bits/stdc++.h>
using namespace std;
char s[107][107];
char w[107];
char t[7];
bool replac[107];
char low(char c) {
  if ('A' <= c && c <= 'Z') return (char)((int)c - 'A' + 'a');
  return c;
}
int main() {
  int i, j, k, l, m, n, x, y, z, a, b, r;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%s", s[i]);
  scanf("%s", w);
  scanf("%s", t);
  for (i = 0; i < n; i++) {
    for (j = 0; w[j] != '\0'; j++) {
      for (l = 0; s[i][l] != '\0'; l++) {
        if (w[j + l] == '\0' || low(s[i][l]) != low(w[j + l])) break;
      }
      if (s[i][l] == '\0') {
        for (l = 0; s[i][l] != '\0'; l++) {
          replac[j + l] = true;
        }
      }
    }
  }
  for (i = 0; w[i] != '\0'; i++) {
    if (replac[i]) {
      if (t[0] == 'a') {
        if ('A' <= w[i] && w[i] <= 'Z') {
          if (w[i] == 'A')
            w[i] = 'B';
          else
            w[i] = char(int(t[0] - 'a' + 'A'));
        } else {
          if (w[i] == 'a')
            w[i] = 'b';
          else
            w[i] = t[0];
        }
      } else {
        if ('A' <= w[i] && w[i] <= 'Z') {
          if (w[i] == char(int(t[0] - 'a' + 'A')))
            w[i] = 'A';
          else
            w[i] = char(int(t[0] - 'a' + 'A'));
        } else {
          if (w[i] == t[0])
            w[i] = 'a';
          else
            w[i] = t[0];
        }
      }
    }
  }
  printf("%s\n", w);
  return 0;
}
