#include <bits/stdc++.h>
using namespace std;
string s[120];
bool w[120];
string st, ss;
char c1, c2;
int n, l;
inline void to_lower_case(string &st) {
  int l = st.length();
  for (int i = 0; i < l; ++i) {
    if (st[i] >= 'A' && st[i] <= 'Z') st[i] -= ('A' - 'a');
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    to_lower_case(s[i]);
  }
  cin >> st;
  int l = st.length();
  ss = st;
  to_lower_case(st);
  cin >> c1;
  if (c1 == 'a')
    c2 = 'b';
  else
    c2 = 'a';
  memset(w, 0, sizeof(w));
  for (int i = 0; i < n; ++i) {
    string q = s[i];
    int lq = q.length();
    int p = 0;
    while (true) {
      p = st.find(q, p);
      if (p == -1) break;
      for (int j = 0; j < lq; ++j) {
        w[p + j] = true;
      }
      ++p;
    }
  }
  for (int i = 0; i < l; ++i) {
    char t;
    if (w[i]) {
      if (st[i] == c1)
        t = c2;
      else
        t = c1;
    } else
      t = st[i];
    if (ss[i] >= 'A' && ss[i] <= 'Z') t += ('A' - 'a');
    cout << t;
  }
  cout << endl;
  return 0;
}
