#include <bits/stdc++.h>
using namespace std;
bool wb[101];
int main() {
  vector<string> vs;
  string s, w;
  char letter, next;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    vs.push_back(s);
  }
  cin >> w >> letter;
  if (letter == 'a')
    next = 'b';
  else
    next = 'a';
  for (int i = 0; i < n; i++)
    for (int j = 0; j + vs[i].size() <= w.size(); j++) {
      bool match = true;
      for (int k = 0; k < vs[i].size(); k++)
        if (tolower(w[j + k]) != tolower(vs[i][k])) {
          match = false;
          break;
        }
      if (match)
        for (int k = 0; k < vs[i].size(); k++) wb[j + k] = true;
    }
  char ch;
  for (int i = 0; i < w.size(); i++)
    if (wb[i]) {
      if (tolower(w[i]) == letter)
        ch = next;
      else
        ch = letter;
      if (isupper(w[i]))
        w[i] = toupper(ch);
      else
        w[i] = tolower(ch);
    }
  cout << w << '\n';
  return 0;
}
