#include <bits/stdc++.h>
using namespace std;
const int Mn = 100 + 20;
int n;
bool val[Mn];
string s[Mn], copy_, w;
char ch;
int small(char x) {
  if (x >= 'A' && x <= 'Z') {
    x -= 'A';
    x += 'a';
  }
  return x;
}
int caps(char x) {
  if (x >= 'a' && x <= 'z') {
    x -= 'a';
    x += 'A';
  }
  return x;
}
bool good(int l, int r, int i) {
  for (int j = l; j < r; j++) {
    if (w[j] != s[i][j - l]) return false;
  }
  return true;
}
bool check(int x) {
  for (int i = 0; i < n; i++) {
    int z = x - s[i].size() + 1;
    int l = max(z, 0);
    int r = l + s[i].size();
    while (l >= 0 && r <= w.size() && l <= x && r >= x) {
      if (good(l, r, i)) {
        return true;
      }
      l++;
      r++;
    }
  }
  return false;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  cin >> w;
  for (int i = 0; i < w.size(); i++) copy_ += w[i];
  cin >> ch;
  for (int i = 0; i < w.size(); i++) {
    w[i] = small(w[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].size(); j++) {
      s[i][j] = small(s[i][j]);
    }
  }
  ch = small(ch);
  for (int i = 0; i < w.size(); i++) {
    if (check(i) == 1) {
      val[i] = 1;
    }
  }
  for (int i = 0; i < w.size(); i++) {
    if (val[i] == 1) {
      if (w[i] == ch) {
        if (w[i] == 'a')
          w[i] = 'b';
        else {
          w[i] = 'a';
        }
      } else
        w[i] = ch;
    }
  }
  for (int i = 0; i < w.size(); i++) {
    if (copy_[i] <= 'Z' && copy_[i] >= 'A') w[i] = caps(w[i]);
  }
  for (int i = 0; i < w.size(); i++) {
    cout << w[i];
  }
  cout << endl;
  return 0;
}
