#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    vector<string> sn(n);
    for (int i = 0; i < n; ++i) {
      cin >> sn[i];
      for (unsigned int j = 0; j < sn[i].size(); ++j)
        sn[i][j] = tolower(sn[i][j]);
    }
    string w;
    cin >> w;
    char letter;
    cin >> letter;
    string lw = w;
    for (unsigned int i = 0; i < lw.size(); ++i) lw[i] = tolower(lw[i]);
    vector<char> rep(w.size(), '\0');
    for (unsigned int i = 0; i < sn.size(); ++i) {
      string::size_type s = 0, t;
      do {
        t = lw.find(sn[i], s);
        if (t != string::npos) {
          for (unsigned int j = 0; j < sn[i].size(); ++j) {
            if (lw[t + j] == letter) {
              if (letter != 'a')
                rep[t + j] = 'a';
              else
                rep[t + j] = 'b';
            } else {
              rep[t + j] = letter;
            }
          }
        }
        s = t + 1;
      } while (t != string::npos);
    }
    for (unsigned int i = 0; i < w.size(); ++i) {
      if (rep[i] != '\0') {
        if (islower(w[i]))
          w[i] = tolower(rep[i]);
        else
          w[i] = toupper(rep[i]);
      }
    }
    cout << w << endl;
  }
  return 0;
}
