#include <bits/stdc++.h>
using namespace std;
struct Coder {
  int idx;
  int a;
  int h;
  int nIBetter;
  Coder() {
    idx = 0;
    a = 0;
    h = 0;
    nIBetter = 0;
  }
  void display() { cout << idx << " " << a << " " << h << endl; }
};
struct TimeFormat {
  int hour;
  int minute;
  TimeFormat() {}
  void display() {
    cout << hour << ":";
    if (minute < 10) {
      cout << "0" << minute;
    } else
      cout << minute;
  }
};
struct Appointment {
  TimeFormat start;
  TimeFormat end;
  string name;
  Appointment() {}
};
TimeFormat dist(TimeFormat a, TimeFormat b) {
  int minutea = a.hour * 60 + a.minute;
  int minuteb = b.hour * 60 + b.minute;
  int d = minuteb - minutea;
  TimeFormat ret;
  ret.hour = d / 60;
  ret.minute = d % 60;
  return ret;
}
bool cmpTimeFormat(TimeFormat a, TimeFormat b) {
  if (a.hour != b.hour) {
    return a.hour < b.hour;
  }
  return a.minute < b.minute;
}
bool cmpAppointment(Appointment a, Appointment b) {
  return cmpTimeFormat(a.start, b.start);
}
int myabs(int x) { return x < 0 ? -x : x; }
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
int toInt(char xx) { return xx - '0'; }
char toChar(int xx) { return xx + '0'; }
bool isNum(char xx) { return ('0' <= xx && xx <= '9'); }
bool isCharacter(char xx) {
  return (('a' <= xx && xx <= 'z') || ('A' <= xx && xx <= 'Z'));
}
bool isUpper(char xx) { return ('A' <= xx && xx <= 'Z'); }
bool isLower(char xx) { return ('a' <= xx && xx <= 'z'); }
bool isPalin(string x) {
  int len = x.length();
  for (int i = 0; i <= len / 2; ++i) {
    if (x[i] != x[len - 1 - i]) return false;
  }
  return true;
}
void swapInt(int &x, int &y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
string tolowerStr(string x) {
  string ret = "";
  for (int i = 0; i < (int)x.size(); ++i) {
    ret.push_back(tolower(x[i]));
  }
  return ret;
}
string toupperStr(string x) {
  string ret = "";
  for (int i = 0; i < (int)x.size(); ++i) {
    ret.push_back(toupper(x[i]));
  }
  return ret;
}
template <class T>
bool isInArray(T x, vector<T> vt) {
  for (int i = 0; i < (int)vt.size(); ++i) {
    if (vt[i] == x) {
      return true;
    }
  }
  return false;
}
string trim(string x) {
  int l = 0, r = x.size() - 1;
  char arr[] = {'\f', '\v', '\t', '\r', '\n', ' '};
  vector<char> delimiter(arr, arr + sizeof(arr) / sizeof(char));
  while (isInArray(x[l], delimiter)) {
    l++;
  }
  while (isInArray(x[r], delimiter)) {
    r--;
  }
  return x.substr(l, r - l + 1);
}
vector<string> getToken(string x, vector<char> tokens) {
  int icounter = 0, lastIndex = x.length() - 1;
  vector<string> ret;
  for (;;) {
    string tmp = "";
    while (icounter <= lastIndex && isInArray(x[icounter], tokens)) icounter++;
    while (icounter <= lastIndex && !isInArray(x[icounter], tokens)) {
      tmp.push_back(x[icounter]);
      icounter++;
    }
    if (tmp.length() > 0) ret.push_back(tmp);
    if (icounter > lastIndex) break;
  }
  return ret;
}
inline void clear_buffer() {
  string tmp;
  getline(cin, tmp);
}
bool cmp(Coder x, Coder y) {
  if (x.a != y.a) {
    return x.a < y.a;
  }
  if (x.h != y.h) {
    return x.h < y.h;
  }
  return x.idx < y.idx;
}
long long val(long long x) {
  if (x < 0) return -x;
  return x;
}
int nextIndexInCircle(int n, int currentPosition, int firstPointIndex) {
  if (firstPointIndex == 0) {
    return (currentPosition + 1) % n;
  } else {
    if (currentPosition == n - 1) {
      return n;
    } else {
      return (currentPosition + 1) % n;
    }
  }
}
const int bfsz = 1 << 16;
char bf[bfsz + 5];
int rsz = 0;
int ptr = 0;
char gc() {
  if (rsz <= 0) {
    ptr = 0;
    rsz = fread(bf, 1, bfsz, stdin);
    if (rsz <= 0) return EOF;
  }
  --rsz;
  return bf[ptr++];
}
void ga(char &c) {
  c = EOF;
  while (!isalpha(c)) c = gc();
}
int gs(char s[]) {
  int l = 0;
  char c = gc();
  while (isspace(c)) c = gc();
  while (c != EOF && !isspace(c)) {
    s[l++] = c;
    c = gc();
  }
  s[l] = '\0';
  return l;
}
template <class T>
bool gi(T &v) {
  v = 0;
  char c = gc();
  while (c != EOF && c != '-' && !isdigit(c)) c = gc();
  if (c == EOF) return false;
  bool neg = c == '-';
  if (neg) c = gc();
  while (isdigit(c)) {
    v = v * 10 + c - '0';
    c = gc();
  }
  if (neg) v = -v;
  return true;
}
template <class T>
inline void checkmin(T &a, T b) {
  if (b < a) a = b;
}
void st_build(vector<int> &t, vector<int> data, int node, int l, int r) {
  if (l == r) {
    t[node] = l;
    return;
  }
  int mid = (l + r) / 2;
  st_build(t, data, 2 * node, l, mid);
  st_build(t, data, 2 * node + 1, mid + 1, r);
  int datal = data[t[2 * node]];
  int datar = data[t[2 * node + 1]];
  if (datal > datar) {
    t[node] = t[2 * node];
  } else {
    t[node] = t[2 * node + 1];
  }
}
void st_create(vector<int> &t, const vector<int> &data) {
  int n = data.size();
  int len = (int)(2 * pow(2.0, floor((log((double)n) / log(2.0)) + 1)));
  t.assign(len, 0);
  st_build(t, data, 1, 0, n - 1);
}
int st_query(vector<int> &t, vector<int> &data, int node, int l, int r, int i,
             int j) {
  if (r < i || j < l) return -1;
  if (l == r) {
    return l;
  }
  if (l >= i && r <= j) {
    return t[node];
  }
  int mid = (l + r) / 2;
  int tl = st_query(t, data, 2 * node, l, mid, i, j);
  int tr = st_query(t, data, 2 * node + 1, mid + 1, r, i, j);
  if (tl == -1) return tr;
  if (tr == -1) return tl;
  if (data[tl] > data[tr]) {
    return tl;
  } else {
    return tr;
  }
}
int st_update(vector<int> &t, vector<int> &data, int node, int l, int r,
              int idx, int newVal) {
  if (l > idx || idx > r) {
    return -1;
  }
  if (l == r) {
    if (l == idx) {
      data[idx] = newVal;
      return idx;
    } else {
      return l;
    }
  }
  int mid = (l + r) / 2;
  int tl = st_update(t, data, 2 * node, l, mid, idx, newVal);
  int tr = st_update(t, data, 2 * node + 1, mid + 1, r, idx, newVal);
  if (tl == -1) {
    t[node] = tr;
    return tr;
  }
  if (tr == -1) {
    t[node] = tl;
    return tl;
  }
  if (data[tl] > data[tr]) {
    t[node] = tl;
    return tl;
  } else {
    t[node] = tr;
    return tr;
  }
}
void ft_create(vector<int> &t, int n) { t.assign(n + 1, 0); }
int ft_get(vector<int> &t, int idx) {
  int ret = 0;
  while (idx > 0) {
    ret += t[idx];
    idx -= (idx & (-idx));
  }
  return ret;
}
void ft_update(vector<int> &t, int idx) {
  int incrementValue = 1;
  while (idx < 100001) {
    t[idx] += incrementValue;
    idx += (idx & (-idx));
  }
}
const int maxn = 1e2 + 3;
int n;
vector<string> fb;
string w;
char key;
bool replaced[maxn];
int lenw;
void readEachTest() {}
void initEachTest() {}
void solveEachTest() {}
void read() {
  cin >> n;
  string x;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    fb.push_back(x);
  }
  cin >> w;
  cin >> key;
}
void init() {
  lenw = w.length();
  for (int k = 0; k < n; ++k) {
    string x = fb[k];
    int lenx = x.length();
    if (lenx <= lenw) {
      int i = 0, j = 0;
      while (i < lenw - lenx + 1) {
        j = 0;
        while (j < lenx && i + j < lenw && tolower(x[j]) == tolower(w[i + j])) {
          j++;
        }
        if (j == lenx) {
          for (int p = i; p < i + j; ++p) {
            replaced[p] = true;
          }
        }
        i++;
      }
    }
  }
}
void solve() {
  for (int i = 0; i < lenw; ++i) {
    if (replaced[i]) {
      if (tolower(w[i]) != key) {
        w[i] = isLower(w[i]) ? key : toupper(key);
      } else {
        if (isLower(w[i])) {
          for (char x = 'a'; x <= 'z'; ++x) {
            if (x != w[i]) {
              w[i] = x;
              break;
            }
          }
        } else {
          for (char x = 'A'; x <= 'Z'; ++x) {
            if (x != w[i]) {
              w[i] = x;
              break;
            }
          }
        }
      }
    }
  }
  cout << w;
}
int main() {
  read();
  init();
  solve();
  return 0;
}
