#include <bits/stdc++.h>
using namespace std;
vector<int> pos[110];
int main() {
  int N;
  cin >> N;
  vector<string> forb;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < s.length(); j++) s[j] = (char)tolower(s[j]);
    forb.push_back(s);
  }
  string orig;
  cin >> orig;
  char lucky;
  cin >> lucky;
  string low_orig = orig;
  for (int i = 0; i < low_orig.length(); i++)
    low_orig[i] = tolower(low_orig[i]);
  for (int i = 0; i < N; i++) {
    size_t found = 0;
    string s = forb[i];
    int N1 = orig.length();
    do {
      if (found > N1) break;
      found = low_orig.find(s, found);
      if (found == string::npos) break;
      if (found != string::npos) pos[i].push_back(found);
      found++;
    } while (true);
  }
  string ret = orig;
  for (int i = 0; i < N; i++) {
    string s = forb[i];
    int n = s.length();
    for (int j = 0; j < pos[i].size(); j++) {
      for (int k = 0; k < n; k++) {
        int idx = pos[i][j] + k;
        char cur = tolower(orig[idx]);
        char next;
        if (cur != lucky) {
          next = lucky;
        } else {
          if (lucky == 'a')
            next = 'b';
          else
            next = 'a';
        }
        if (cur != orig[idx]) next = toupper(next);
        ret[idx] = next;
      }
    }
  }
  cout << ret << endl;
  return 0;
}
