#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
string s[105], w;
int n;
char t;
bool vis[105];
map<int, bool> mp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < s[i].size(); j++) s[i][j] = tolower(s[i][j]);
  }
  cin >> w >> t;
  for (int i = 0; i < w.size(); i++) {
    if (w[i] >= 'A' && w[i] <= 'Z') mp[i] = 1;
    w[i] = tolower(w[i]);
  }
  for (int i = 0; i < n; i++) {
    string tmp = w;
    int sft = 0;
    while (tmp.find(s[i]) != -1) {
      int idx = tmp.find(s[i]);
      for (int j = idx + sft; j < sft + idx + s[i].size(); j++) {
        vis[j] = 1;
      }
      tmp = tmp.substr(idx + 1);
      sft += idx + 1;
    }
  }
  for (int i = 0; i < w.size(); i++) {
    if (vis[i] == 1) {
      if (w[i] != t)
        w[i] = t;
      else if (w[i] != 'a')
        w[i] = 'a';
      else
        w[i] = 'b';
    }
    if (mp[i]) w[i] = toupper(w[i]);
  }
  cout << w << endl;
  return 0;
}
