#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> vs(n);
  for (int i = 0; i < n; i++) cin >> vs[i];
  string t;
  char c;
  cin >> t >> c;
  int m = t.size();
  vector<bool> flag(m), aux(m), upp(m);
  for (int i = 0; i < m; i++) {
    if (isupper(t[i])) upp[i] = 1;
    t[i] = tolower(t[i]);
  }
  for (auto s : vs) {
    int len = s.size();
    for (int i = 0; i < len; i++) s[i] = tolower(s[i]);
    for (int i = 0; i <= m - len; i++) {
      if (t.substr(i, len) == s) {
        for (int j = 0; j < len; j++) {
          aux[i + j] = ((s[j] == c) | aux[i + j]);
          flag[i + j] = 1;
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (!flag[i]) {
      if (upp[i]) t[i] = toupper(t[i]);
      continue;
    }
    if (aux[i]) {
      if (t[i] == 'a')
        t[i] = 'b';
      else
        t[i] = 'a';
    } else
      t[i] = c;
    if (upp[i]) t[i] = toupper(t[i]);
  }
  cout << t;
}
