#include <bits/stdc++.h>
using namespace std;
const int MAXn = 100;
int n;
string f[MAXn];
string s;
char let;
bool b[1000];
bool isUp(char c) { return c >= 'A' && c <= 'Z'; }
bool isLow(char c) { return c >= 'a' && c <= 'z'; }
char toLow(char c) { return isUp(c) ? (c - 'A' + 'a') : c; }
char toUp(char c) { return isUp(c) ? c : (c - 'a' + 'A'); }
bool check(char c1, char c2) { return toLow(c1) == toLow(c2); }
bool check(int pos, string &s2) {
  for (int i = pos; i < pos + (int)s2.size(); i++) {
    if (i >= (int)s.size()) return false;
    if (!check(s[i], s2[i - pos])) return false;
  }
  return true;
}
char F(char c, char c2) {
  if (isUp(c2))
    return toUp(c);
  else
    return toLow(c);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> f[i];
  cin >> s;
  cin >> let;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < (int)s.size(); j++)
      if (check(j, f[i]))
        for (int k = 0; k < (int)f[i].size(); k++) b[j + k] = true;
  for (int i = 0; i < (int)s.size(); i++) {
    if (b[i]) {
      if (check(s[i], let))
        s[i] = F(check(let, 'a') ? 'b' : 'a', s[i]);
      else
        s[i] = F(let, s[i]);
    }
  }
  cout << s << endl;
  return 0;
}
