#include <bits/stdc++.h>
using namespace std;
string s, t[105];
char c;
int n, i, j, k;
bool ned[105], upp[105];
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> t[i];
    for (j = 0; j < t[i].size(); j++) t[i][j] = tolower(t[i][j]);
  }
  cin >> s >> c;
  for (j = 0; j < s.size(); j++) {
    if (isupper(s[j])) {
      s[j] = tolower(s[j]);
      upp[j] = true;
    }
  }
  c = tolower(c);
  for (i = 1; i <= n; i++) {
    for (j = 0; j + t[i].size() <= s.size(); j++) {
      bool ok = false;
      for (k = 0; k < t[i].size(); k++) {
        if (s[j + k] != t[i][k]) {
          ok = true;
          break;
        }
      }
      if (ok) continue;
      for (k = 0; k < t[i].size(); k++) {
        ned[k + j] = true;
      }
    }
  }
  for (i = 0; i < s.size(); i++) {
    if (ned[i]) {
      if (s[i] != c)
        s[i] = c;
      else if (c == 'a')
        s[i] = 'b';
      else
        s[i] = 'a';
    }
    if (upp[i]) s[i] = toupper(s[i]);
  }
  cout << s;
  return 0;
}
