func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, a, b;     cin >> n;     map<int, vector<vector<int> > > m;     vector<int> v, ans;     map<int, int> s;     for (int i = 0; i < n - 2; i++) {       int f, g, h;       cin >> f >> g >> h;       v.push_back(f);       v.push_back(g);       v.push_back(h);       s[f]++;       s[g]++;       s[h]++;       m[f].push_back(v);       m[g].push_back(v);       m[h].push_back(v);       v.clear();     }     for (auto i = s.begin(); i != s.end(); i++) {       if (i->second == 1) {         ans.push_back(i->first);         for (auto p = m[i->first].begin(); p != m[i->first].end(); p++) {           auto j = *p;           for (int u = 0; u < 3; u++) {             if (s[j[u]] == 2) a = j[u];             if (s[j[u]] == 3) b = j[u];           }         }         ans.push_back(a);         ans.push_back(b);         break;       }     }     while (ans.size() < n) {       int x, y, z, t;       t = ans.size();       x = ans[t - 1];       y = ans[t - 2];       z = ans[t - 3];       for (auto p = m[y].begin(); p != m[y].end(); p++) {         auto j = *p;         if (((j[0] == y && j[1] == x) || (j[0] == x && j[1] == y)) && j[2] != z)           ans.push_back(j[2]);         else if (((j[0] == y && j[2] == x) || (j[0] == x && j[2] == y)) &&                  j[1] != z)           ans.push_back(j[1]);         else if (((j[1] == y && j[2] == x) || (j[1] == x && j[2] == y)) &&                  j[0] != z)           ans.push_back(j[0]);       }     }     for (auto c : ans) {       cout << c <<    ;     }     return 0;   }   