#include <bits/stdc++.h>
using namespace std;
int n, l;
string str[105];
char letter;
bool change[105];
int main() {
  scanf("%d ", &n);
  for (int i = 1; i <= n; i++) cin >> str[i];
  cin >> str[0];
  cin >> str[102];
  letter = str[102][0];
  if (letter >= 'A' && letter <= 'Z') letter += 32;
  l = str[0].size();
  for (int i = 0; i < l; i++) change[i] = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j + str[i].size() <= l; j++) {
      bool flag = 1;
      for (int k = 0; k < str[i].size(); k++)
        if ((str[i][k] - str[0][j + k]) % 32 != 0) {
          flag = 0;
          break;
        }
      if (flag)
        for (int k = 0; k < str[i].size(); k++) change[j + k] = 1;
    }
  for (int i = 0; i < l; i++) {
    char tmp = str[0][i];
    if (change[i]) {
      if ((tmp - letter) % 32 != 0) {
        if (tmp >= 'a' && tmp <= 'z')
          tmp = letter;
        else
          tmp = letter - 32;
      } else {
        if (tmp >= 'a' && tmp <= 'z')
          tmp = (letter == 'a') ? 'b' : 'a';
        else
          tmp = (letter == 'a') ? 'B' : 'A';
      }
    }
    str[0][i] = tmp;
  }
  cout << str[0];
}
