#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
T power(T N, T P) {
  return (P == 0) ? 1 : N * power(N, P - 1);
}
template <class T>
bool inside(T a, T b, T c) {
  return (b >= a && b <= c);
}
double dist(double x1, double y1, double x2, double y2) {
  return sqrt(sqr(x1 - x2) + sqr(y1 - y2));
}
int distsq(int x1, int y1, int x2, int y2) {
  return sqr(x1 - x2) + sqr(y1 - y2);
}
int toInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
long long toInt64(string s) {
  long long r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double toDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double LOG(long long N, long long B) { return (log10l(N)) / (log10l(B)); }
string itoa(long long a) {
  if (a == 0) return "0";
  string ret;
  for (long long i = a; i > 0; i = i / 10) ret.push_back((i % 10) + 48);
  reverse(ret.begin(), ret.end());
  return ret;
}
vector<string> token(string a, string b) {
  const char *q = a.c_str();
  while (count(b.begin(), b.end(), *q)) q++;
  vector<string> oot;
  while (*q) {
    const char *e = q;
    while (*e && !count(b.begin(), b.end(), *e)) e++;
    oot.push_back(string(q, e));
    q = e;
    while (count(b.begin(), b.end(), *q)) q++;
  }
  return oot;
}
int isvowel(char s) {
  s = tolower(s);
  if (s == 'a' || s == 'e' || s == 'i' || s == 'o' || s == 'u') return 1;
  return 0;
}
int isupper(char s) {
  if (s >= 'A' and s <= 'Z') return 1;
  return 0;
}
int SET(int N, int pos) { return N = N | (1 << pos); }
int RESET(int N, int pos) { return N = N & ~(1 << pos); }
int check(int N, int pos) { return (N & (1 << pos)); }
int toggle(int N, int pos) {
  if (check(N, pos)) return N = RESET(N, pos);
  return N = SET(N, pos);
}
void PRINTBIT(int N) {
  for (int i = 6; i >= 1; i--) {
    bool x = check(N, i);
    cout << x;
  }
  puts("");
}
string s;
int a[500000][3], top = 0;
void f(string &w) {
  for (int i = 0; s[i]; i++) {
    if (s[i] == w[0]) {
      int flag = 1;
      for (int j = 0, c = i; w[j]; j++, c++) {
        if (w[j] != s[c]) {
          flag = 0;
          break;
        }
      }
      if (flag) {
        a[top][0] = i;
        a[top][1] = i + w.size() - 1;
        top++;
      }
    }
  }
}
int main() {
  string w[103];
  int n;
  string letter;
  while (cin >> n) {
    top = 0;
    for (__typeof(n) i = 0; i < (n); i++) {
      cin >> w[i];
      for (int j = 0; w[i][j]; j++) {
        w[i][j] = tolower(w[i][j]);
      }
    }
    cin >> s;
    string s2 = s;
    for (int i = 0; s[i]; i++) s[i] = tolower(s[i]);
    cin >> letter;
    for (__typeof(n) i = 0; i < (n); i++) {
      f(w[i]);
    }
    for (int i = 0; s[i]; i++) {
      int flag = 0;
      for (int j = 0; j < top; j++) {
        int l = a[j][0], h = a[j][1];
        if (i >= l && i <= h) {
          flag = 1;
          break;
        }
      }
      if (flag) {
        if (s[i] != letter[0])
          s[i] = letter[0];
        else if (s[i] != 'a')
          s[i] = 'a';
        else
          s[i] = 'b';
      }
      if (s2[i] >= 'A' && s2[i] <= 'Z') s[i] = toupper(s[i]);
    }
    cout << s << endl;
  }
}
