#include <bits/stdc++.h>
using namespace std;
const int SIZE = 210;
char A[SIZE][SIZE];
char S[SIZE], S1[SIZE];
bool B[SIZE];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i != N; i++) {
    cin >> A[i];
    for (int j = 0, len = strlen(A[i]); j != len; j++)
      if (A[i][j] >= 'A' && A[i][j] <= 'Z') A[i][j] += ('a' - 'A');
  }
  cin >> S;
  for (int i = 0, len = strlen(S); i != len; i++)
    if (S[i] >= 'A' && S[i] <= 'Z')
      S1[i] = S[i] + ('a' - 'A');
    else
      S1[i] = S[i];
  for (int i = 0, len = strlen(S); i != len; i++)
    for (int j = 0; j != N; j++) {
      int L = strlen(A[j]);
      char t = S1[i + L];
      S1[i + L] = '\0';
      if (!strcmp(A[j], S1 + i))
        for (int k = i; k != i + L; k++) B[k] = true;
      S1[i + L] = t;
    }
  char ch;
  cin >> ch;
  int len = strlen(S);
  for (int i = 0; i != len; i++)
    if (B[i]) {
      if (S1[i] != ch)
        S1[i] = ch;
      else if (S1[i] != 'a')
        S1[i] = 'a';
      else
        S1[i] = 'b';
    }
  for (int i = 0; i != len; i++)
    if (S[i] >= 'A' && S[i] <= 'Z') S1[i] -= 'a', S1[i] += 'A';
  cout << S1;
  return 0;
}
