#include <bits/stdc++.h>
using namespace std;
int mrk[150];
char busma, busmi;
int let(char x) {
  if (x >= 'A' && x <= 'Z') {
    return x - 'A';
  } else {
    return x - 'a';
  }
}
char corr(char x) {
  if (x >= 'A' && x <= 'Z' && x != busma) {
    return busma;
  } else if (x >= 'A' && x <= 'Z' && x == busma) {
    if (busma == 'A') {
      return 'B';
    }
    return 'A';
  } else if (x != busmi) {
    return busmi;
  } else {
    if (busmi == 'a') {
      return 'b';
    }
    return 'a';
  }
}
int main(void) {
  string org;
  string forb[150];
  string gen;
  int n;
  char bus;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    cin >> forb[i];
  }
  cin >> org;
  bus = 10;
  while (bus == 10) {
    scanf("%c", &bus);
  }
  if (bus >= 'a' && bus <= 'z') {
    busmi = bus;
    busma = bus + ('A' - 'a');
  } else {
    busma = bus;
    busmi = bus + ('a' - 'A');
  }
  int ig;
  for (int i = 0; i < n; i++) {
    for (int j = 0;
         (j <= (org.size() - forb[i].size())) && (forb[i].size() <= org.size());
         j++) {
      ig = 1;
      for (int k = 0; k < forb[i].size(); k++) {
        if (let(forb[i][k]) != let(org[j + k])) {
          ig = 0;
          break;
        }
      }
      if (ig == 1) {
        for (int k = j; k < j + forb[i].size(); k++) {
          mrk[k] = 1;
        }
      }
    }
  }
  for (int i = 0; i < org.size(); i++) {
    if (!mrk[i]) {
      printf("%c", org[i]);
    } else {
      printf("%c", corr(org[i]));
    }
  }
  printf("\n");
  return 0;
}
