#include <bits/stdc++.h>
using namespace std;
int isLower(char c) { return 97 <= c && c <= 122; }
int isUpper(char c) { return 65 <= c && c <= 90; }
char toLower(char ch) {
  if (isLower(ch)) return ch;
  return ch + 32;
}
string toLower(string str) {
  string ans;
  int i;
  for ((i) = 0; (i) < (int)(((int)(str).size())); (i)++) {
    ans += (isLower(str[i])) ? str[i] : (str[i] + 32);
  }
  return ans;
}
int main() {
  int arr[105];
  memset(arr, 0, sizeof(arr));
  int n;
  cin >> n;
  string fbd[105], str;
  string charr;
  char ch;
  int i, j, k;
  for ((i) = 0; (i) < (int)(n); (i)++) cin >> fbd[i];
  cin >> str;
  cin >> charr;
  ch = charr[0];
  for ((i) = 0; (i) < (int)(n); (i)++) {
    int len1 = ((int)(str).size()), len2 = ((int)(fbd[i]).size());
    for ((j) = 0; (j) < (int)(len1 - len2 + 1); (j)++)
      if (toLower(str.substr(j, len2)) == toLower(fbd[i])) {
        for (k = j; k < j + len2; k++) arr[k] = 1;
      }
  }
  for ((i) = 0; (i) < (int)(((int)(str).size())); (i)++)
    if (arr[i]) {
      if (toLower(str[i]) != toLower(ch)) {
        if (isLower(str[i]))
          str[i] = toLower(ch);
        else
          str[i] = (toLower(ch) - 32);
      } else {
        if (isLower(str[i])) {
          if (toLower(ch) != 'a')
            str[i] = 'a';
          else
            str[i] = 'b';
        } else {
          if (toLower(ch) != 'a')
            str[i] = 'A';
          else
            str[i] = 'B';
        }
      }
    }
  cout << str;
  cin.get();
  cin.get();
  return 0;
}
