func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long nax = 1e5 + 10;   vector<long long> g[nax];   signed main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     ;     long long n;     cin >> n;     long long f = 0;     vector<pair<pair<long long, long long>, long long> > a(n - 2);     for (long long i = 0; i < n - 2; i++) {       long long x, y, z;       cin >> x >> y >> z;       a[i].first.first = x;       a[i].first.second = y;       a[i].second = z;       g[x].push_back(i);       g[y].push_back(i);       g[z].push_back(i);     }     for (long long i = 1; i <= n; i++) {       if (g[i].size() == 1) {         f = i;         break;       }     }     vector<long long> ans;     long long id = g[f][0];     long long cur1 = -1, cur2 = -1;     if (a[id].first.first != f) {       cur1 = a[id].first.first;       if (a[id].second != f)         cur2 = a[id].second;       else         cur2 = a[id].first.second;     } else {       cur1 = a[id].first.second, cur2 = a[id].second;     }     ans.push_back(f);     ans.push_back(cur1);     ans.push_back(cur2);     long long cd = cur1;     long long dc = cur2;     set<long long> yy;     yy.insert(id);     while (ans.size() < n) {       for (auto &i : g[cur1])         if (yy.find(i) == yy.end()) id = i;       yy.insert(id);       if (a[id].first.first != cur1 && a[id].first.first != cur2)         ans.push_back(a[id].first.first);       else if (a[id].first.second != cur1 && a[id].first.second != cur2)         ans.push_back(a[id].first.second);       else         ans.push_back(a[id].second);       cur1 = ans[ans.size() - 2];       cur2 = ans.back();     }     vector<long long> ans1;     id = g[f][0];     cur1 = dc;     cur2 = cd;     ans1.push_back(f);     ans1.push_back(cur1);     ans1.push_back(cur2);     set<long long> xx;     xx.insert(id);     while (ans1.size() < n) {       for (auto &i : g[cur1])         if (xx.find(i) == xx.end()) id = i;       xx.insert(id);       if (a[id].first.first != cur1 && a[id].first.first != cur2)         ans1.push_back(a[id].first.first);       else if (a[id].first.second != cur1 && a[id].first.second != cur2)         ans1.push_back(a[id].first.second);       else         ans1.push_back(a[id].second);       cur1 = ans1[ans1.size() - 2];       cur2 = ans1.back();     }     set<long long> s1, s2;     for (auto &i : ans) s1.insert(i);     for (auto &i : ans1) s2.insert(i);     if (s1.size() == n)       for (auto &i : ans) cout << i <<    ;     else       for (long long i = 0; i < n; i++) cout << ans1[i] <<    ;   }   