#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < (int)(n); i++) cin >> s[i];
  string w;
  cin >> w;
  char t;
  cin >> t;
  vector<bool> should_replace(w.size());
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(w.size() - s[i].size() + 1); j++) {
      bool is = true;
      for (int k = 0; k < (int)(s[i].size()); k++) {
        if (tolower(w[j + k]) != tolower(s[i][k])) {
          is = false;
          break;
        }
      }
      if (!is) continue;
      for (int k = 0; k < (int)(s[i].size()); k++) should_replace[j + k] = true;
    }
  }
  for (int i = 0; i < (int)(w.size()); i++) {
    if (!should_replace[i]) continue;
    if ('a' <= w[i] && w[i] <= 'z') {
      if (w[i] == 'a' && t == 'a')
        w[i] = 'b';
      else if (w[i] == t)
        w[i] = 'a';
      else
        w[i] = t;
    } else {
      if (w[i] == 'A' && t == 'a')
        w[i] = 'B';
      else if (w[i] == toupper(t))
        w[i] = 'A';
      else
        w[i] = toupper(t);
    }
  }
  cout << w << endl;
  return 0;
}
