func_code_string: #include <bits/stdc++.h>   using namespace std;   struct DirectedEulerPath {     int n;     vector<vector<int> > g;     vector<int> path;     void init(int _n) {       n = _n;       g = vector<vector<int> >(n + 1, vector<int>());       path.clear();     }     void add_edge(int u, int v) { g[u].push_back(v); }     void dfs(int u) {       while (g[u].size()) {         int v = g[u].back();         g[u].pop_back();         dfs(v);       }       path.push_back(u);     }     bool getPath() {       int ctEdges = 0;       vector<int> outDeg, inDeg;       outDeg = inDeg = vector<int>(n + 1, 0);       for (int i = 1; i <= n; i++) {         ctEdges += g[i].size();         outDeg[i] += g[i].size();         for (auto &u : g[i]) inDeg[u]++;       }       int ctMiddle = 0, src = 1;       for (int i = 1; i <= n; i++) {         if (abs(inDeg[i] - outDeg[i]) > 1) return 0;         if (inDeg[i] == outDeg[i]) ctMiddle++;         if (outDeg[i] > inDeg[i]) src = i;       }       if (ctMiddle != n && ctMiddle + 2 != n) return 0;       dfs(src);       reverse(path.begin(), path.end());       return (path.size() == ctEdges + 1);     }   } ep;   string arr[(int)5e5], rev[(int)5e5];   map<string, int> comp;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     ;     int n;     cin >> n;     for (int x = 0; x < n; x++) {       cin >> arr[x];       comp[arr[x].substr(0, 2)];       comp[arr[x].substr(1, 2)];     }     int cnt = 1;     for (auto x : comp) {       comp[x.first] = cnt;       rev[cnt++] = x.first;     }     ep.init(cnt);     for (int x = 0; x < n; x++)       ep.add_edge(comp[arr[x].substr(0, 2)], comp[arr[x].substr(1, 2)]);     bool ok = ep.getPath();     if (!ok) return 0 * printf( NO n );     cout <<  YES n ;     string ans = rev[ep.path[0]];     for (int x = 1; x < (int)ep.path.size(); x++) ans += rev[ep.path[x]].back();     cout << ans <<   n ;   }   