#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
struct ToLower {
  char operator()(char c) { return tolower(c); }
};
bool cmp(string s, string t) {
  transform(s.begin(), s.end(), s.begin(), ToLower());
  transform(t.begin(), t.end(), t.begin(), ToLower());
  if (s == t)
    return true;
  else
    return false;
}
int main() {
  istream &fin = cin;
  ostream &fout = cout;
  FILE *fpin = stdin;
  FILE *fpout = stdout;
  int n;
  fin >> n;
  vector<string> forbid(n);
  for (int i = 0; i < n; i++) fin >> forbid[i];
  string w;
  fin >> w;
  char letter;
  fin >> letter;
  vector<int> bad(w.size(), 0);
  int letidx = letter - 'a';
  for (int i = 0; i < (int)w.size(); i++) {
    for (int j = 0; j < n; j++) {
      if (cmp(w.substr(i, forbid[j].size()), forbid[j])) {
        for (int k = i; k < i + (int)forbid[j].size(); k++) bad[k] = 1;
      }
    }
  }
  int subidx = 0;
  if (letidx == 0) subidx++;
  for (int i = 0; i < (int)w.size(); i++) {
    if (!bad[i]) continue;
    if (islower(w[i])) {
      if (w[i] != 'a' + letidx)
        w[i] = 'a' + letidx;
      else
        w[i] = 'a' + subidx;
    } else {
      if (w[i] != 'A' + letidx)
        w[i] = 'A' + letidx;
      else
        w[i] = 'A' + subidx;
    }
  }
  fout << w << endl;
}
