#include <bits/stdc++.h>
using namespace std;
string pattern[110], text;
bool change_val[110];
char target;
char my_lower(char cchar) {
  if (cchar >= 'a' && cchar <= 'z') return cchar;
  return cchar - 'A' + 'a';
}
bool compare_lowercase(int pattern_indx, int indx) {
  string pttrn = pattern[pattern_indx];
  for (int i = 0; i < pttrn.size(); i++)
    if (my_lower(pttrn[i]) != my_lower(text[indx + i])) return 0;
  return 1;
}
int main() {
  int n, sz;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> pattern[i];
  cin >> text >> target;
  sz = text.size();
  for (int i = 0; i < n; i++)
    for (int indx = 0; indx + pattern[i].size() - 1 < sz; indx++)
      if (compare_lowercase(i, indx))
        for (int j = indx; j < indx + pattern[i].size(); j++) change_val[j] = 1;
  for (int i = 0; i < sz; i++) {
    if (change_val[i]) {
      if (text[i] >= 'A' && text[i] <= 'Z') {
        if (text[i] != target - 'a' + 'A')
          text[i] = target - 'a' + 'A';
        else if (text[i] == 'A')
          text[i] = 'B';
        else
          text[i] = 'A';
      } else {
        if (text[i] != target)
          text[i] = target;
        else if (text[i] == 'a')
          text[i] = 'b';
        else
          text[i] = 'a';
      }
    }
  }
  cout << text;
  return 0;
}
