#include <bits/stdc++.h>
using namespace std;
long long labs(long long a) { return a < 0 ? (-a) : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
template <typename T>
struct Point {
  T x, y;
  Point() {}
  Point(T xx, T yy) : x(xx), y(yy) {}
};
template <typename T>
bool operator<(const Point<T> &p1, const Point<T> &p2) {
  return p1.x < p2.x || p1.x == p2.x && p1.y < p2.y;
}
string reg_mem;
void SaveRegister(const string &s) { reg_mem = s; }
void RestoreRegister(string &s) {
  for (int(i) = 0; (i) < (s.size()); (i)++) {
    if (isupper(reg_mem[i])) {
      s[i] = toupper(s[i]);
    } else {
      s[i] = tolower(s[i]);
    }
  }
}
void ToLower(string &t) {
  for (int(i) = 0; (i) < (t.size()); (i)++) {
    t[i] = tolower(t[i]);
  }
}
vector<string> v;
vector<bool> mask;
int main() {
  string s;
  int n;
  char lck;
  cin >> n;
  v.resize(n);
  for (int(i) = 0; (i) < (n); (i)++) {
    cin >> v[i];
    ToLower(v[i]);
  }
  cin >> s >> lck;
  SaveRegister(s);
  ToLower(s);
  mask.assign(s.size(), false);
  for (int(i) = 0; (i) < (n); (i)++) {
    for (int j = 0; j + v[i].size() <= s.size(); j++) {
      if (s.substr(j, v[i].size()) == v[i]) {
        for (int k = j; k < j + v[i].size(); k++) {
          mask[k] = true;
        }
      }
    }
  }
  for (int(i) = 0; (i) < (s.size()); (i)++) {
    if (mask[i]) {
      if (s[i] != lck) {
        s[i] = lck;
      } else if (s[i] != 'a') {
        s[i] = 'a';
      } else {
        s[i] = 'b';
      }
    }
  }
  RestoreRegister(s);
  cout << s;
  return 0;
}
