#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
const int INF = 1 << 30;
const double eps = 1e-10;
const int mod = 1000000007;
char s[105][105], sd[105];
bool cp(int i, int j) {
  int len = strlen(s[j]);
  for (int k = 0; k < len; k++) {
    if (tolower(s[j][k]) != tolower(sd[k + i])) return false;
  }
  return true;
}
bool used[105];
int main() {
  int n;
  char c;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  scanf("%s", sd);
  getchar();
  scanf("%c", &c);
  int len = strlen(sd);
  for (int i = 0; i < len; i++) {
    for (int j = 0; j < n; j++) {
      if (cp(i, j)) {
        int ls = strlen(s[j]);
        for (int k = i; k < i + ls; k++) {
          used[k] = true;
        }
        continue;
      }
    }
  }
  for (int i = 0; i < len; i++) {
    if (used[i]) {
      char cc = tolower(sd[i]);
      if (cc != c)
        cc = c;
      else {
        if (cc == 'a')
          cc = 'b';
        else
          cc = 'a';
      }
      sd[i] = isupper(sd[i]) ? toupper(cc) : cc;
    }
  }
  cout << sd << endl;
  return 0;
}
