#include <bits/stdc++.h>
using namespace std;
inline void read(register int *n) {
  register char c;
  *n = 0;
  do {
    c = getchar();
  } while (c < '0' || c > '9');
  do {
    *n = c - '0' + *n * 10;
    c = getchar();
  } while (c >= '0' && c <= '9');
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> s(n);
  for (register int i = (0); i < (int)(n); ++i) cin >> s[i];
  string t;
  cin >> t;
  bool change[111];
  memset(change, 0, sizeof change);
  for (register int i = (0); i < (int)(((int)(t).size())); ++i) {
    for (register int j = (0); j < (int)(n); ++j) {
      bool bad = false;
      for (register int k = (0); k < (int)(((int)(s[j]).size())); ++k)
        if (i + k >= ((int)(t).size()) || t[i + k] % 32 != s[j][k] % 32)
          bad = true;
      if (!bad)
        for (register int k = (0); k < (int)(((int)(s[j]).size())); ++k)
          change[i + k] = true;
    }
  }
  char c;
  cin >> c;
  for (register int i = (0); i < (int)(((int)(t).size())); ++i)
    if (change[i]) {
      if (t[i] % 32 != c % 32)
        t[i] = t[i] - t[i] % 32 + c % 32;
      else {
        char d = t[i];
        t[i] = t[i] - t[i] % 32 + 1;
        while (t[i] % 32 == c % 32 || t[i] % 32 == d % 32) t[i]++;
      }
    }
  cout << t << "\n";
  return 0;
}
