#include <bits/stdc++.h>
using namespace std;
char bad[101][101], w[101], ch;
int n, m, c[101];
bitset<101> is;
void solve(int testcase) {
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    cin >> bad[i] + 1;
  }
  cin >> w + 1;
  cin >> ch;
  ch = (char)tolower(ch);
  m = strlen(w + 1);
  for (int i = (1); i <= (m); i++) {
    if (w[i] >= 'a' && w[i] <= 'z')
      c[i] = 1;
    else
      c[i] = 2;
    w[i] = (char)tolower(w[i]);
  }
  for (int i = (1); i <= (n); i++) {
    int x = strlen(bad[i] + 1);
    for (int j = (1); j <= (x); j++) bad[i][j] = (char)tolower(bad[i][j]);
    if (x <= m) {
      for (int j = (1); j <= (m - x + 1); j++) {
        bool ok = true;
        for (int k = (1); k <= (x); k++) {
          if (bad[i][k] != w[j + k - 1]) {
            ok = false;
            break;
          }
        }
        if (ok) {
          for (int k = (1); k <= (x); k++) is[j + k - 1] = 1;
        }
      }
    }
  }
  for (int i = (1); i <= (m); i++) {
    if (is[i]) {
      if (w[i] == ch) {
        if (ch == 'a')
          w[i] = 'b';
        else
          w[i] = 'a';
      } else
        w[i] = ch;
    }
    if (c[i] == 2) w[i] = (char)toupper(w[i]);
  }
  cout << w + 1;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(10);
  clock_t b = clock();
  int t = 1;
  for (int tt = (1); tt <= (t); tt++) solve(tt);
  clock_t e = clock();
  cerr << (double(e - b) / CLOCKS_PER_SEC) << " sec";
  return 0;
}
