func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAXN = 1e3 + 5;   bool adj1[MAXN][MAXN], adj2[MAXN][MAXN];   vector<pair<int, int> > ans1, ans2;   int n;   void comp1(int a, int b) {     if (b - a == 1) return;     for (int i = a + 1; i < b; ++i) {       if (adj1[1][i] == 1) {         comp1(a, i);         comp1(i, b);         return;       }     }     assert(adj1[a][b] == 1);     for (int i = a + 1; i < b; ++i) {       if (adj1[i][a] * adj1[i][b] == 1) {         ans1.push_back(make_pair(a, b));         adj1[a][b] = adj1[b][a] = 0;         adj1[1][i] = adj1[i][1] = 1;         comp1(a, i);         comp1(i, b);         return;       }     }   }   void comp2(int a, int b) {     if (b - a == 1) return;     for (int i = a + 1; i < b; ++i) {       if (adj2[1][i] == 1) {         comp2(a, i);         comp2(i, b);         return;       }     }     assert(adj2[a][b] == 1);     for (int i = a + 1; i < b; ++i) {       if (adj2[i][a] * adj2[i][b] == 1) {         ans2.push_back(make_pair(1, i));         adj2[a][b] = adj2[b][a] = 0;         adj2[1][i] = adj2[i][1] = 1;         comp2(a, i);         comp2(i, b);         return;       }     }   }   int main() {     cin >> n;     for (int i = 0; i < n - 3; ++i) {       int u, v;       cin >> u >> v;       adj1[u][v] = adj1[v][u] = 1;     }     for (int i = 0; i < n - 3; ++i) {       int u, v;       cin >> u >> v;       adj2[u][v] = adj2[v][u] = 1;     }     for (int i = 0; i < n; ++i) {       adj1[i + 1][(i + 1) % n + 1] = adj1[(i + 1) % n + 1][i + 1] =           adj2[i + 1][(i + 1) % n + 1] = adj2[(i + 1) % n + 1][i + 1] = 1;     }     comp1(2, n);     comp2(2, n);     cout << ans1.size() + ans2.size() << endl;     for (int i = 0; i < ans1.size(); ++i)       cout << ans1[i].first <<     << ans1[i].second << endl;     for (int i = ans2.size() - 1; i >= 0; --i)       cout << ans2[i].first <<     << ans2[i].second << endl;   }   