#include <bits/stdc++.h>
using namespace std;
void str_tolower(string& s) {
  transform(s.begin(), s.end(), s.begin(), ::tolower);
}
int main() {
  int n;
  cin >> n;
  string* s = new string[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    str_tolower(s[i]);
  }
  string hockey;
  cin >> hockey;
  string hockey_find = hockey;
  str_tolower(hockey_find);
  set<int> exchange;
  for (int i = 0; i < n; i++) {
    int found = hockey_find.find(s[i]);
    ;
    while (found != string::npos) {
      for (int j = found, end = j + s[i].size(); j < end; j++) {
        exchange.insert(j);
      }
      found = hockey_find.find(s[i], found + 1);
    }
  }
  char lovely;
  cin >> lovely;
  char exchanger = 'a';
  if (lovely == 'a') exchanger = 'b';
  for (int i = 0, end = hockey.size(); i < end; i++) {
    if (exchange.count(i)) {
      if (hockey_find[i] == lovely) {
        if (isupper(hockey[i]))
          cout << (char)toupper(exchanger);
        else
          cout << exchanger;
      } else {
        if (isupper(hockey[i]))
          cout << (char)toupper(lovely);
        else
          cout << lovely;
      }
    } else {
      cout << hockey[i];
    }
  }
  return 0;
}
