#include <bits/stdc++.h>
using namespace std;
int len[101];
char a[101][101];
char t[101];
bool ok(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }
char change(char c) {
  if (c >= 'a')
    return c;
  else
    return c + 32;
}
bool equal(int x, int y) {
  int i;
  for (i = 1; i <= len[x]; i++)
    if (a[x][i] != t[y + i]) return false;
  return true;
}
char newletter(char c, char d) {
  if (c >= 'a')
    return d;
  else
    return d - 32;
}
int main() {
  int n, i, j, k, l;
  char c, letter;
  char s[101];
  bool flag[101];
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    while (c = getchar(), !ok(c))
      ;
    a[i][len[i] = 1] = change(c);
    while (c = getchar(), ok(c)) a[i][++len[i]] = change(c);
  }
  while (c = getchar(), !ok(c))
    ;
  s[l = 1] = c;
  while (c = getchar(), ok(c)) s[++l] = c;
  for (i = 1; i <= l; i++) t[i] = change(s[i]);
  while (letter = getchar(), !ok(letter))
    ;
  letter = change(letter);
  for (i = 1; i <= l; i++) flag[i] = false;
  for (i = 1; i <= n; i++)
    for (j = 0; j <= l - len[i]; j++)
      if (equal(i, j))
        for (k = 1; k <= len[i]; k++) flag[j + k] = true;
  for (i = 1; i <= l; i++)
    if (flag[i])
      if (t[i] != letter)
        s[i] = newletter(s[i], letter);
      else if (t[i] != 'a')
        s[i] = newletter(s[i], 'a');
      else
        s[i] = newletter(s[i], 'b');
  for (i = 1; i <= l; i++) printf("%c", s[i]);
  printf("\n");
  return 0;
}
