#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100 + 5;
int main() {
  int n;
  string forb[MAXN];
  string str;
  char letter;
  while (cin >> n) {
    for (int i = 0; i < n; i++) cin >> forb[i];
    cin >> str >> letter;
    bool mark[MAXN];
    fill(mark, mark + (int)str.size(), false);
    for (int i = 0; i < (int)str.size(); i++) {
      for (int j = 0; j < n; j++) {
        int m = forb[j].length();
        bool flag = true;
        for (int k = 0; k < m; k++) {
          if (tolower(forb[j][k]) != tolower(str[i + k])) {
            flag = false;
            break;
          }
        }
        if (flag) fill(mark + i, mark + i + m, true);
      }
    }
    for (int i = 0; i < (int)str.size(); i++) {
      if (mark[i]) {
        if (tolower(str[i]) != tolower(letter)) {
          if (islower(str[i]))
            str[i] = tolower(letter);
          else
            str[i] = toupper(letter);
        } else {
          char tmp = tolower(letter) == 'a' ? 'b' : 'a';
          if (islower(str[i]))
            str[i] = tolower(tmp);
          else
            str[i] = toupper(tmp);
        }
      }
    }
    cout << str << endl;
  }
}
