#include <bits/stdc++.h>
using namespace std;
inline bool check(string a, string b) {
  int n = a.size();
  if (b.size() != n) return false;
  for (int i = 0; i < n; i++) {
    char ca, cb;
    if (a[i] >= 'A' && a[i] <= 'Z')
      ca = a[i] - 'A';
    else
      ca = a[i] - 'a';
    if (b[i] >= 'A' && b[i] <= 'Z')
      cb = b[i] - 'A';
    else
      cb = b[i] - 'a';
    if (ca != cb) return false;
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(32);
  int n;
  cin >> n;
  vector<string> v(n);
  for (auto &x : v) {
    cin >> x;
  }
  string w;
  cin >> w;
  char fav[2];
  cin >> fav[0];
  fav[1] = fav[0] - 'a' + 'A';
  int m = w.size();
  vector<int> bad(m);
  for (int i = 0; i < n; i++) {
    int k = v[i].size();
    for (int j = 0; j <= m - k; j++) {
      if (check(w.substr(j, k), v[i])) {
        for (int ii = j; ii < j + k; ii++) {
          bad[ii] = 1;
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (bad[i]) {
      if (w[i] == fav[0] || w[i] == fav[1]) {
        for (int ch = 0; ch < 26; ch++) {
          if (ch == fav[0] - 'a') continue;
          if (w[i] == fav[0]) {
            w[i] = char(ch + 'a');
          } else {
            w[i] = char(ch + 'A');
          }
          break;
        }
      } else if (w[i] >= 'A' && w[i] <= 'Z') {
        w[i] = fav[1];
      } else {
        w[i] = fav[0];
      }
    }
  }
  cout << w << endl;
  return 0;
}
