#include <bits/stdc++.h>
using namespace std;
void tolower(string &str) {
  for (int i = 0; i < str.size(); ++i) {
    str[i] = tolower(str[i]);
  }
}
int main(void) {
  int n;
  string forbidden[100];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> forbidden[i];
    tolower(forbidden[i]);
  }
  string team_name;
  cin >> team_name;
  char lucky;
  cin >> lucky;
  lucky = tolower(lucky);
  const int len = team_name.size();
  string low_team = team_name;
  tolower(low_team);
  bool invalid[100];
  for (int i = 0; i < len; ++i) invalid[i] = false;
  for (int i = 0; i < n; ++i) {
    const int m = forbidden[i].size();
    for (int j = 0;; ++j) {
      j = low_team.find(forbidden[i], j);
      if (j == string::npos) break;
      for (int k = 0; k < m; ++k) {
        invalid[k + j] = true;
      }
    }
  }
  for (int i = 0; i < len; ++i) {
    if (!invalid[i]) continue;
    char &t = team_name[i];
    char s = (low_team[i] != lucky) ? lucky : (lucky == 'a') ? 'b' : 'a';
    t = isupper(t) ? toupper(s) : s;
  }
  cout << team_name << "\n";
  return 0;
}
