#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, vis[107] = {0};
  cin >> n;
  string arrOFs[107];
  for (long long i = 1; i <= (long long)n; ++i) cin >> arrOFs[i];
  string s;
  cin >> s;
  char c;
  cin >> c;
  string t = s;
  c = tolower(c);
  for (long long i = 0; i <= (long long)t.size() - 1; ++i) t[i] = tolower(t[i]);
  string ans = t;
  for (long long j = 1; j <= (long long)n; ++j) {
    for (long long i = 0; i <= (long long)arrOFs[j].size() - 1; ++i)
      arrOFs[j][i] = tolower(arrOFs[j][i]);
  }
  for (long long j = 1; j <= (long long)n; ++j) {
    string tmp = arrOFs[j];
    if (tmp.size() > t.size()) continue;
    for (long long i = 0; i <= (long long)t.size() - tmp.size(); ++i) {
      if (t.substr(i, tmp.size()) == tmp) {
        for (long long k = i; k <= (long long)i + tmp.size() - 1; ++k) {
          if (vis[k]) continue;
          vis[k] = 1;
          if (t[k] == c) {
            if (c != 'a')
              ans[k] = 'a';
            else
              ans[k] = 'b';
          } else
            ans[k] = c;
        }
      }
    }
  }
  for (long long i = 0; i <= (long long)s.size() - 1; ++i) {
    if (isupper(s[i])) ans[i] = toupper(ans[i]);
  }
  cout << ans;
}
