#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkmin(T &a, T b) {
  if (a > b) a = b;
}
void solve() {
  int n;
  cin >> n;
  vector<string> forbiddens(n);
  for (int i = 0; i < (n); i++) {
    cin >> forbiddens[i];
    for (int j = 0; j < (((int)forbiddens[i].length())); j++)
      if (forbiddens[i][j] <= 'Z') forbiddens[i][j] += 'a' - 'A';
  }
  string w, s;
  cin >> w;
  s = w;
  for (int i = 0; i < (((int)s.length())); i++)
    if (s[i] <= 'Z') s[i] += 'a' - 'A';
  char letter;
  cin >> letter;
  vector<int> st, ed;
  for (__typeof(forbiddens.begin()) ite = forbiddens.begin();
       ite != forbiddens.end(); ite++) {
    string::size_type pos = 0;
    while (1) {
      pos = s.find((*ite), pos);
      if (pos == string::npos) break;
      st.push_back(pos);
      ed.push_back(((int)(*ite).length()));
      pos += 1;
    }
  }
  for (int i = 0; i < (((int)st.size())); i++) {
    int pos = st[i];
    int epos = st[i] + ed[i];
    for (int i = pos; i < epos; i++) {
      char ch = letter;
      if (s[i] == letter && ch != 'a')
        ch = 'a';
      else if (s[i] == letter && ch == 'a')
        ch = 'b';
      if (w[i] <= 'Z') {
        w[i] = ch;
        w[i] -= 'a' - 'A';
      } else
        w[i] = ch;
    }
  }
  cout << w << endl;
}
int main() {
  solve();
  return 0;
}
