#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> s;
  s.resize(n);
  for (int i = (0); i < (n); ++i) {
    cin >> s[i];
  }
  string A;
  cin >> A;
  char l;
  cin >> l;
  l = toupper(l) - 'A' + 'a';
  vector<bool> b;
  b.resize(int((A).size()), false);
  for (int i = (0); i < (n); ++i) {
    for (int j = (0); j < (int((A).size()) - int((s[i]).size()) + 1); ++j) {
      bool is = true;
      for (int k = (0); k < (int((s[i]).size())); ++k) {
        if (toupper(s[i][k]) != toupper(A[j + k])) {
          is = false;
          break;
        }
      }
      if (is) {
        for (int k = (0); k < (int((s[i]).size())); ++k) {
          b[j + k] = true;
        }
      }
    }
  }
  char ch = 'a';
  if (l == ch) ch++;
  for (int i = (0); i < (int((b).size())); ++i) {
    if (b[i]) {
      if (toupper(A[i]) == toupper(l)) {
        if (A[i] == toupper(A[i]))
          A[i] = toupper(ch);
        else
          A[i] = ch;
      } else if (A[i] == toupper(A[i]))
        A[i] = toupper(l);
      else
        A[i] = l;
    }
  }
  cout << A << endl;
  return 0;
}
