#include <bits/stdc++.h>
using namespace std;
string tolow(string s) {
  for (auto &c : s) c = tolower(c);
  return s;
}
set<string> contain;
bool chk[105];
void chk_cred(string s) {
  for (int i = 0; i < s.size(); i++) {
    for (auto v : contain) {
      if (v.size() > s.size() - i) continue;
      int len = v.size();
      if (v == tolow(s.substr(i, len))) {
        for (int j = i; j < i + len; j++) chk[j] = true;
      }
    }
  }
}
vector<string> forbid;
string s;
char letter;
int n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  forbid.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> forbid[i];
    contain.insert(tolow(forbid[i]));
  }
  cin >> s >> letter;
  chk_cred(s);
  int cnt = 0;
  letter = tolower(letter);
  int offset = 'a' - 'A';
  for (int i = 0; i < s.size(); i++) {
    if (!chk[i]) continue;
    if (tolower(s[i]) == letter && letter == 'a')
      s[i] = (islower(s[i]) ? 'b' : 'B'), cnt++;
    else if (tolower(s[i]) == letter && letter != 'a')
      s[i] = (islower(s[i]) ? 'a' : 'A'), cnt++;
    else
      s[i] = (!islower(s[i]) ? toupper(letter) : letter), cnt++;
  }
  cout << s << '\n';
  return 0;
}
