#include <bits/stdc++.h>
using namespace std;
double esp = 1e-11;
#pragma comment(linker, "/STACK:1024000000,1024000000")
const double PI = acos(-1.0);
const long long int INF = 0x3f3f3f3f3f3f3f3f;
const long long int MOD = 1000000007;
const int maxn = 1010000;
string s[1001], s1, s2;
int mark[101000];
int main() {
  int n;
  cin >> n;
  for (int x = 1; x <= n; x++) cin >> s[x];
  cin >> s1;
  char c;
  cin >> c;
  memset(mark, 0, sizeof(mark));
  s2 = s1;
  int len, len1 = s1.length();
  for (int y = 0; y < len1; y++) s1[y] = tolower(s1[y]);
  for (int x = 1; x <= n; x++) {
    len = s[x].length();
    for (int y = 0; y < len; y++) s[x][y] = tolower(s[x][y]);
    for (int y = 0; y <= len1 - len; y++)
      if (s[x] == s1.substr(y, len)) {
        for (int z = y; z <= y + len - 1; z++) mark[z] = 1;
      }
  }
  s1 = s2;
  for (int x = 0; x < len1; x++)
    if (mark[x]) {
      if (tolower(s1[x]) == tolower(c)) {
        if (tolower(s1[x]) == 'a')
          s1[x]++;
        else
          s1[x] -= tolower(s1[x]) - 'a';
      } else
        s1[x] -= tolower(s1[x]) - tolower(c);
    }
  cout << s1;
  return 0;
}
