#include <bits/stdc++.h>
using namespace std;
void perform() {
  int n;
  cin >> n;
  vector<string> v;
  while (n--) {
    string t;
    cin >> t;
    for (int i = 0; i < t.length(); i++) {
      if (t[i] < 'a') t[i] += ('a' - 'A');
    }
    v.push_back(t);
  }
  string s, l, ans;
  char r;
  cin >> s >> r;
  l = s;
  for (int i = 0; i < l.length(); i++) {
    if (l[i] < 'a') l[i] += ('a' - 'A');
  }
  ans = l;
  for (int i = 0; i < v.size(); i++) {
    size_t loc = l.find(v[i]);
    while (loc != string::npos) {
      for (int j = loc; j < loc + v[i].length(); j++) {
        if (ans[j] == l[j]) {
          if (l[j] == r) {
            if (l[j] == 'a')
              ans[j] = 'b';
            else
              ans[j] = 'a';
          } else
            ans[j] = r;
        }
      }
      loc = l.find(v[i], loc + 1);
    }
  }
  for (int i = 0; i < s.length(); i++) {
    if (s[i] < 'a') ans[i] -= ('a' - 'A');
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    perform();
  }
}
