#include <bits/stdc++.h>
using namespace std;
char A[200][200];
int len[200];
char S[200];
bool bad[200];
char _C[2];
char C;
char toupper(char c) {
  if (c >= 'a' && c <= 'z') return (c - 'a' + 'A');
  return c;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", A[i]);
    len[i] = strlen(A[i]);
  }
  scanf("%s %s", S, _C);
  C = _C[0];
  int slen = strlen(S);
  for (int i = 0; i < slen; i++) bad[i] = false;
  for (int i = 0; i < slen; i++) {
    int low = i, high = i - 1;
    for (int j = 0; j < n; j++) {
      bool eq = true;
      int k;
      for (k = 0; (k < len[j]) && (i + k < slen); k++) {
        if (toupper(S[i + k]) != toupper(A[j][k])) {
          eq = false;
          break;
        }
      }
      if (eq && (k == len[j])) high = max(high, i + k - 1);
    }
    for (int i = low; i <= high; i++) bad[i] = true;
  }
  for (int i = 0; i < slen; i++) {
    if (bad[i]) {
      if ((S[i] >= 'A' && S[i] <= 'Z')) {
        if (toupper(C) != S[i]) {
          S[i] = toupper(C);
        } else {
          for (char j = 'a'; j <= 'z'; j++)
            if (toupper(j) != S[i]) {
              S[i] = toupper(j);
              break;
            }
        }
      } else {
        if (C != S[i]) {
          S[i] = C;
        } else {
          for (char j = 'a'; j <= 'z'; j++)
            if (j != S[i]) {
              S[i] = j;
              break;
            }
        }
      }
    }
  }
  printf("%s\n", S);
}
