#include <bits/stdc++.h>
using namespace std;
bool isCapital(char arg) {
  if ('A' <= arg && arg <= 'Z') {
    return true;
  } else {
    return false;
  }
}
int main(void) {
  int n, tmp, length;
  char letter;
  vector<string> pattern;
  vector<int> index;
  string str;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str;
    for (int j = 0; j < str.size(); j++) {
      if (isCapital(str[j])) {
        str[j] -= 'A' - 'a';
      }
    }
    pattern.push_back(str);
  }
  cin >> str;
  bool cap[str.size()];
  memset(cap, false, sizeof(cap));
  for (int i = 0; i < str.size(); i++) {
    if (isCapital(str[i])) {
      cap[i] = true;
      str[i] -= 'A' - 'a';
    }
  }
  cin >> letter;
  if (isCapital(letter)) letter -= 'A' - 'a';
  bool replace[str.size()];
  memset(replace, false, sizeof(replace));
  int ind = 0;
  for (int i = 0; i < n; i++) {
    length = pattern[i].size();
    while (1) {
      ind = str.find(pattern[i], ind);
      if (ind == string::npos) break;
      for (int j = 0; j < length; j++) {
        replace[ind + j] = true;
      }
      ind++;
    }
    ind = 0;
  }
  for (int i = 0; i < str.size(); i++) {
    if (replace[i] == true) {
      if (str[i] != letter && str[i] != letter + 'A' - 'a') {
        if (cap[i]) {
          str[i] = letter + 'A' - 'a';
        } else {
          str[i] = letter;
        }
      } else {
        if (letter == 'a') {
          if (cap[i]) {
            str[i] = 'B';
          } else {
            str[i] = 'b';
          }
        } else {
          if (cap[i]) {
            str[i] = 'A';
          } else {
            str[i] = 'a';
          }
        }
      }
    } else if (cap[i]) {
      str[i] += 'A' - 'a';
    }
  }
  cout << str << endl;
}
