#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[104], s1, s2;
  char z;
  int x;
  cin >> x;
  for (int i = 0; i < x; i++) {
    cin >> s[i];
  }
  cin >> s[x];
  cin >> z;
  for (int i = 0; i < x; i++) {
    for (int j = 0; j < s[i].length(); j++) s[i][j] = (char)tolower(s[i][j]);
  }
  s2 = s1 = s[x];
  for (int i = 0; i < s[x].length(); i++) {
    s2[i] = s1[i] = (char)tolower(s1[i]);
  }
  s2[s[x].length()] = s1[s[x].length()] = '\0';
  int flag = 0;
  z = tolower(z);
  for (int i = 0; i < x; i++) {
    int pos = 0, z1 = -1;
    while (s2.find(s[i], z1 + 1) != s1.npos) {
      flag = 0;
      z1 = s2.find(s[i], z1 + 1);
      for (int j = 0; j < s[i].length(); j++) {
        if (s2[j + z1] != z)
          s1[j + z1] = z;
        else if (z != 'a')
          s1[j + z1] = 'a';
        else
          s1[j + z1] = 'b';
      }
    }
  }
  for (int i = 0; i < s[x].length(); i++) {
    if (islower(s[x][i]))
      printf("%c", (char)tolower(s1[i]));
    else
      printf("%c", (char)toupper(s1[i]));
  }
}
