#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:136777216")
using namespace std;
int bits(int x) { return x == 0 ? 0 : 1 + bits(x & (x - 1)); }
int main() {
  int n;
  cin >> n;
  vector<string> v;
  for (int(i) = 0; (i) < (n); (i)++) {
    string s;
    cin >> s;
    for (int(i) = 0; (i) < ((int)(s).size()); (i)++) s[i] = tolower(s[i]);
    v.push_back(s);
  }
  bool up[111] = {0};
  string ans, t;
  cin >> ans;
  t = ans;
  for (int(i) = 0; (i) < ((int)(t).size()); (i)++)
    if (isupper(t[i])) up[i] = 1;
  for (int(i) = 0; (i) < ((int)(t).size()); (i)++) t[i] = tolower(t[i]);
  char c;
  cin >> c;
  bool need[111] = {0};
  for (int(i) = 0; (i) < (n); (i)++) {
    for (int(j) = 0; (j) < ((int)(t).size() - (int)(v[i]).size() + 1); (j)++) {
      if (t.substr(j, (int)(v[i]).size()) == v[i]) {
        for (int(k) = (j); (k) < (j + (int)(v[i]).size()); (k)++) {
          need[k] = 1;
        }
      }
    }
  }
  for (int(i) = 0; (i) < ((int)(t).size()); (i)++) {
    if (need[i]) {
      if (tolower(ans[i]) != c) {
        ans[i] = c;
      } else {
        if (c == 'a') {
          ans[i] = 'b';
        } else {
          ans[i] = 'a';
        }
      }
      if (up[i]) {
        ans[i] = toupper(ans[i]);
      }
    }
  }
  cout << ans;
  return 0;
}
