#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int fail[N];
int kmp(char pat[], char txt[], vector<int> &ans) {
  memset(fail, -1, sizeof(fail));
  int psz = strlen(pat);
  for (int i = 1; i < psz; i++) {
    int j = fail[i - 1];
    while (j != -1 && pat[j + 1] != pat[i]) j = fail[j];
    if (pat[j + 1] == pat[i]) j++;
    fail[i] = j;
  }
  int ret = 0;
  int tsz = strlen(txt);
  for (int i = 0, j = -1; i < tsz; i++) {
    while (j != -1 && pat[j + 1] != txt[i]) j = fail[j];
    if (pat[j + 1] == txt[i]) j++;
    if (j == psz - 1) {
      ans.push_back(i);
      ret++;
      j = fail[j];
    }
  }
  return ret;
}
int dp[N];
char change[200];
char letter;
char txt[N];
bool upper[N];
struct Node {
  char str[N];
  int val;
  bool operator<(const Node &p) const {
    if (val != p.val) return val < p.val;
    return strcmp(str, p.str) < 0;
  }
} a[N];
vector<int> ans[N];
int slen[N];
bool cover[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i].str);
    int j;
    for (j = 0; a[i].str[j]; j++)
      if (a[i].str[j] < 'a') a[i].str[j] += 32;
    a[i].str[j] = 0;
  }
  scanf("%s", txt);
  int len = strlen(txt);
  for (int i = 0; i < len; i++) {
    if (txt[i] < 'a') {
      upper[i] = true;
      txt[i] += 32;
    }
  }
  txt[len] = 0;
  cin >> letter;
  if (letter < 'a') letter += 32;
  for (char cur = 'a'; cur <= 'z'; cur++) {
    if (cur != letter)
      change[cur] = letter;
    else if (letter != 'a')
      change[cur] = 'a';
    else
      change[cur] = 'b';
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    kmp(a[i].str, txt, ans[i]);
    slen[i] = strlen(a[i].str);
    for (int j = 0; j < ans[i].size(); j++) {
      for (int k = 0; k < slen[i]; k++) cover[ans[i][j] - k] = true;
    }
  }
  for (int i = 0; i < len; i++) {
    if (cover[i]) txt[i] = change[txt[i]];
    if (upper[i]) txt[i] -= 32;
  }
  txt[len] = 0;
  cout << txt << endl;
}
