#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
int N, L;
string bad[MAXN];
string str;
string temp;
char bchar;
char bchar2;
bool rep[MAXN];
inline string tolo(string x) {
  string ret = "";
  for (int i = 0; i < (int)x.size(); i++) {
    ret += tolower(x[i]);
  }
  return ret;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> bad[i];
  }
  cin >> str;
  cin >> temp;
  bchar = temp[0];
  bchar2 = 'A';
  while (tolower(bchar2) == tolower(bchar)) {
    bchar2++;
  }
  L = str.length();
  for (int i = 0; i < N; i++) {
    string comp = tolo(bad[i]);
    int len = comp.size();
    for (int j = 0; j + len <= L; j++) {
      if (tolo(str.substr(j, len)) == comp) {
        for (int k = j; k < j + len; k++) {
          rep[k] = true;
        }
      }
    }
  }
  for (int i = 0; i < L; i++) {
    if (rep[i]) {
      if (tolower(str[i]) == tolower(bchar)) {
        if (isupper(str[i])) {
          str[i] = toupper(bchar2);
        } else {
          str[i] = tolower(bchar2);
        }
      } else {
        if (isupper(str[i])) {
          str[i] = toupper(bchar);
        } else {
          str[i] = tolower(bchar);
        }
      }
    }
  }
  cout << str << endl;
  return 0;
}
