#include <bits/stdc++.h>
using namespace std;
bool a[100][26], b[100];
int main() {
  int n;
  char c;
  string s[100], w, w1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < s[i].size(); j++)
      if (s[i][j] <= 'Z' && s[i][j] >= 'A') s[i][j] = s[i][j] - 'A' + 'a';
  }
  cin >> w;
  w1 = w;
  for (int j = 0; j < w1.size(); j++)
    if (w1[j] <= 'Z' && w1[j] >= 'A') w1[j] = w1[j] - 'A' + 'a';
  cin >> c;
  int k;
  for (int i = 0; i < n; i++)
    if (s[i].size() <= w1.size())
      for (int j = 0; j <= w1.size() - s[i].size() + 1; j++) {
        k = 1;
        for (int h = 0; h < s[i].size(); h++)
          if (s[i][h] != w1[j + h]) {
            k = 0;
            break;
          }
        if (k)
          for (int h = 0; h < s[i].size(); h++) {
            a[j + h][s[i][h] - 'a'] = true;
            b[j + h] = true;
          }
      }
  for (int i = 0; i < w1.size(); i++)
    if (b[i])
      if (!a[i][c - 'a'])
        w1[i] = c;
      else {
        int j = 0;
        while (a[i][j]) j++;
        w1[i] = char(j + 'a');
      }
  for (int i = 0; i < w1.size(); i++)
    if (w[i] >= 'A' && w[i] <= 'Z') w1[i] = w1[i] - 'a' + 'A';
  cout << w1 << endl;
  return 0;
}
