#include <bits/stdc++.h>
using namespace std;
vector<string> v(101);
set<int> s;
string lower(string s) {
  for (int i = 0; i < s.size(); ++i) s[i] = tolower(s[i]);
  return s;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
    v[i] = lower(v[i]);
  }
  string temp, w;
  cin >> w;
  temp = w, w = lower(w);
  char letter;
  cin >> letter;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < w.size(); ++j) {
      int p = w.find(v[i], j);
      if (p != string::npos) {
        int t = p;
        for (; t < p + v[i].size(); ++t) s.insert(t);
      }
    }
  }
  w = temp;
  for (int i = 0; i < w.size(); ++i) {
    if (s.count(i)) {
      if (w[i] <= 'Z') {
        if (w[i] != toupper(letter))
          w[i] = toupper(letter);
        else
          for (char j = 'A'; j <= 'Z'; ++j)
            if (w[i] != j && j != toupper(letter)) {
              w[i] = j;
              break;
            }
      } else {
        if (w[i] != tolower(letter))
          w[i] = tolower(letter);
        else
          for (char j = 'a'; j <= 'z'; ++j)
            if (w[i] != j && j != tolower(letter)) {
              w[i] = j;
              break;
            }
      }
    }
  }
  cout << w;
}
