#include <bits/stdc++.h>
using namespace std;
string a;
vector<pair<int, int> > matches, newMatches;
char letter;
char toSmall(char c) {
  if (c >= 'a' && c <= 'z') return c;
  return c + 'a' - 'A';
}
void replace(int j) {
  bool isSmall = (a[j] >= 'a' && a[j] <= 'z');
  if (toSmall(a[j]) != letter)
    a[j] = (isSmall ? letter : letter + 'A' - 'a');
  else {
    if (letter == 'a')
      a[j] = (isSmall ? 'b' : 'B');
    else
      a[j] = (isSmall ? 'a' : 'A');
  }
  return;
}
void find(string sub) {
  for (int i = 0; i < a.length(); i++) {
    int j = 0;
    for (j = 0; j < sub.length() && i + j < a.length(); j++)
      if (toSmall(a[i + j]) != toSmall(sub[j])) break;
    if (j == sub.length()) matches.push_back(make_pair(i, sub.length()));
  }
  return;
}
int main() {
  int n;
  cin >> n;
  string subs[n];
  for (int i = 0; i < n; i++) cin >> subs[i];
  cin >> a;
  cin >> letter;
  for (int i = 0; i < n; i++) find(subs[i]);
  sort(matches.begin(), matches.end());
  int i = 0;
  while (i != matches.size()) {
    int start = matches[i].first;
    int end = matches[i].first + matches[i].second - 1;
    while (i != matches.size() - 1 && end + 1 >= matches[i + 1].first) {
      end = max(end, matches[i + 1].first + matches[i + 1].second - 1);
      i++;
    }
    newMatches.push_back(make_pair(start, end));
    i++;
  }
  for (int i = 0; i < newMatches.size(); i++)
    for (int j = newMatches[i].first; j <= newMatches[i].second; j++)
      replace(j);
  cout << a << endl;
}
