#include <bits/stdc++.h>
using namespace std;
using namespace std;
int ni() {
  int _num;
  scanf("%d", &_num);
  return _num;
}
int testnum;
bool equals(char c1, char c2) { return tolower(c1) == tolower(c2); }
string our;
string blocker[105];
bool bad[105];
int N;
char precious;
void preprocess() {}
char getFirst() {
  for (char c = 'a'; c <= 'z'; c++)
    if (!equals(c, precious)) return c;
}
void solve() {
  memset(bad, false, sizeof bad);
  for (int i = 0; i < N; i++) {
    for (int j = 0; j + blocker[i].size() <= our.size(); j++) {
      bool match = true;
      for (int k = 0; k < blocker[i].size(); k++)
        if (!equals(our[j + k], blocker[i][k])) match = false;
      if (match)
        for (int k = 0; k < blocker[i].size(); k++) bad[j + k] = true;
    }
  }
  for (int i = 0; i < our.size(); i++) {
    if (bad[i]) {
      if (!equals(our[i], precious)) {
        if (islower(our[i]))
          our[i] = tolower(precious);
        else
          our[i] = toupper(precious);
      } else {
        char now = getFirst();
        our[i] = islower(our[i]) ? tolower(now) : toupper(now);
      }
    }
  }
  cout << our << endl;
}
bool input() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) cin >> blocker[i];
  cin >> our;
  cin >> precious;
  return true;
}
int main() {
  preprocess();
  int T = 1;
  for (testnum = 1; testnum <= T; testnum++) {
    if (!input()) break;
    solve();
  }
}
