#include "bits/stdc++.h" using namespace std; #define rs ranges:: void solve() { int n; cin >> n; vector<string> ss(n); string t; for (auto &e: ss) cin >> e; cin >> t; string res; rs reverse(t); vector<int> p(n); vector<string> pos(t.size()); for (int i = 0; i < n; ++i) { int x = ss[i].size() - 1; for (int j = 0; j < t.size(); ++j) { auto c = t[j]; while (x >= 0 && ss[i][x] != c) { pos[j].push_back(ss[i][x]); --x; } if (x >= 0) { if (j + 1 == t.size()) { cout << "NO\n"; return; } --x; } else { break; } } } for (int i = 0; i < t.size(); ++i) { res += pos[i]; if (i + 1 != t.size()) res += t[i]; } rs reverse(res); cout << "YES\n"; cout << res << '\n'; } signed main() { ios::sync_with_stdio(0); cin.tie(0);cout.tie(0); int t = 1; //cin >> t; while (t--) solve(); }