#include "triangles.h"
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
#define asc(x) x.begin(), x.end()
#define des(x) x.rbegin(), x.rend()
#define pb push_back
#define eb emplace_back
#define ll long long
#define db long double
#define fori(a, b) for (int i = (a); i < (b); ++i)
#define forj(a, b) for (int j = (a); j < (b); ++j)

using namespace std;
// using namespace __gnu_pbds;
// using ordered_set = tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>;


std::vector<std::vector<int>> solve(int n) {
    vector<Triangle> all;

    fori(0, n) {
        vector<Triangle> a, b;

        vector<int> have;
        forj(0, n) {
            if (i == j) continue;

            have.pb(j);
        }

        a.eb(have[0], have[1], have[2]);
        all.eb(have[0], have[1], have[2]);

        for (int j1 = 0; j1 < 3; ++j1) {
            for (int j2 = j1 + 1; j2 < 3; ++j2) {
                b.eb(have[j1], have[j2], i);
            }
        }

        if (compare(a, b) == 0) {
            vector<vector<int>> ans;

            for (int j1 = 0; j1 < 3; ++j1) {
                for (int j2 = j1 + 1; j2 < 3; ++j2) {
                    ans.pb({have[j1], have[j2], i});
                }
            }

            return ans;
        }
    }

    return {{0, 1, 2 ,3}};
}
