#include <bits/stdc++.h>
using namespace std;
const int maxn = 239;
const long long base = 37;
set<long long> HashTable;
int code(char c) {
  if ('a' <= c && c <= 'z') return c - 'a' + 1;
  return c - 'A' + 1;
}
int large(char c) { return (c >= 'A' && c <= 'Z'); }
char str[maxn];
int change[maxn];
char letter[maxn];
char let;
int main() {
  int n;
  scanf("%d", &n);
  memset(change, 0, sizeof change);
  for (int i = 0; i < (n); i++) {
    scanf("%s", str);
    long long hash = 0;
    for (int j = 0; str[j]; j++) hash = hash * base + code(str[j]);
    HashTable.insert(hash);
  }
  scanf("%s", str);
  scanf("%s", letter);
  let = letter[0];
  for (int j = 0; str[j]; j++) {
    for (int i = 0; i <= j; i++) {
      long long hash = 0;
      for (int k = i; k <= j; k++) hash = hash * base + code(str[k]);
      if (HashTable.find(hash) != HashTable.end()) {
        for (int k = i; k <= j; k++) change[k] = 1;
      }
    }
  }
  for (int i = 0; str[i]; i++) {
    if (change[i]) {
      char c = str[i];
      int dif = 0;
      if (large(str[i])) dif = 'A' - 'a';
      for (int t = 'z' + dif; t >= 'a' + dif; t--) {
        if (code(c) != code(t)) {
          str[i] = t;
          if (code(t) == code(let)) break;
        }
      }
    }
  }
  printf("%s\n", str);
  return 0;
}
