#include <bits/stdc++.h>
using namespace std;
vector<string> a;
bool b[1000001];
string s, w;
int n, l;
bool ok;
char c, letter;
inline char func(char a, char b) {
  if (b >= 'a' && a >= 'a') return a;
  if (b >= 'a' && a < 'a') return a + 32;
  if (b < 'a' && a >= 'a') return a - 32;
  return a;
}
inline char another(char c) {
  if (c == 'a' || c == 'A') return c + 1;
  return func('a', c);
}
inline bool cmp(char a, char b) { return (a == b || abs(a - b) == 32); }
inline void make(int l, int r) {
  for (int i = l; i <= r; i++) b[i] = 1;
}
inline int find(string &s, string &w) {
  int l = 0;
  if (w.size() > s.size()) return -1;
  for (int i = 0; i <= s.size() - w.size(); i++) {
    l = i;
    while (l - i < w.size() && cmp(s[l], w[l - i])) l++;
    if (l - i == w.size()) make(i, i + w.size() - 1);
  }
  return -1;
}
int main() {
  scanf("%d\n", &n);
  a.resize(n);
  for (int i = 0; i < n; i++) {
    getline(cin, a[i]);
  }
  getline(cin, s);
  scanf("%c", &letter);
  for (int i = 0; i < n; i++) {
    w = a[i];
    find(s, w);
  }
  for (int i = 0; i < s.size(); i++) {
    c = s[i];
    if (!b[i]) continue;
    if (cmp(c, letter))
      s[i] = another(c);
    else
      s[i] = func(letter, c);
  }
  cout << s;
  return 0;
}
