#include <bits/stdc++.h>
using namespace std;
template <class TT>
TT abs(TT a) {
  if (a < 0) return -a;
  return a;
}
template <class ZZ>
ZZ max(ZZ a, ZZ b, ZZ c) {
  return max(a, max(b, c));
}
template <class ZZ>
ZZ min(ZZ a, ZZ b, ZZ c) {
  return min(a, min(b, c));
}
const int ww = 111;
string a[ww], b[ww];
int main() {
  int ks = 1, tks;
  int i, j, k, n, ch, l;
  string s, cs, ans, cur, ok;
  char lc, c;
  bool f[ww], af[ww];
  while (cin >> n) {
    memset(f, true, sizeof(f));
    for (i = 0; i < n; i++) {
      cin >> a[i];
      b[i] = "";
      for (j = 0; j < ((int)a[i].size()); j++) b[i] += tolower(a[i][j]);
    }
    cin >> s;
    cs = "";
    for (i = 0; i < ((int)s.size()); i++) cs += tolower(s[i]);
    cin >> lc;
    lc = tolower(lc);
    char an = 'a';
    for (i = 0; i < 26; i++)
      if (i + 'a' != lc) {
        an = i + 'a';
        break;
      }
    int m = ((int)s.size());
    ans = ok = cs;
    for (i = 0; i < n; i++) {
      cs = ans;
      k = l = 0;
      while (l < m) {
        cs = ans.substr(l);
        l = (int)cs.find(b[i]);
        if (l < 0) break;
        l += k;
        for (j = l; j < l + ((int)b[i].size()); j++) f[j] = false;
        k++;
        l = k;
      }
    }
    ans = ok;
    for (i = 0; i < m; i++)
      if (!f[i]) {
        if (ans[i] != lc)
          ans[i] = lc;
        else
          ans[i] = an;
      }
    for (i = 0; i < m; i++)
      if (isupper(s[i]))
        ans[i] = toupper(ans[i]);
      else
        ans[i] = tolower(ans[i]);
    cout << ans << endl;
  }
  return 0;
}
