#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <x86intrin.h>
#include "triangles.h"


#ifndef DEBUG
// #pragma GCC optimize("avx2")
// #pragma GCC optimize("O3")
#endif

using namespace __gnu_pbds;
using namespace std::ranges;

using ll = int;
using ld = long double;
template<typename T>
using oset = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using pll = std::pair<ll, ll>;

const ll MOD = 998244353;
const ll MOD1 = 1000000007;

std::mt19937 rnd(std::chrono::steady_clock::now().time_since_epoch().count());

std::vector<std::vector<int>> solve(int n) {
    std::vector<ll> pr = {0, 1, 2, 3};
    std::vector<ll> used(4, 1);
    do {
        std::vector<Triangle> d = {{pr[0], pr[1], pr[3]}, {pr[0], pr[1], pr[2]}};
        std::vector<Triangle> d1 = {{pr[2], pr[3], pr[1]}, {pr[2], pr[3], pr[0]}};
        ll t = compare(d, d1);
        if (t == -1) {
            used[pr[2]] = 0;
            used[pr[3]] = 0;
        }
        if (t == 0) {
            return {{pr[0], pr[2], pr[1]}, {pr[0], pr[2], pr[3]}};
        }
        if (t == 1) {
            used[pr[0]] = 0;
            used[pr[1]] = 0;
        }
    }while (std::next_permutation(pr.begin(), pr.end()));
    ll curt = 0;
    std::vector<ll> nn;
    for (int i = 0; i < 4; ++i) {
        if (used[i]) {
            curt = i;
        }
        else {
            nn.push_back(i);
        }
    }
    std::vector<std::vector<int>> anss;
    for (int d = 0; d < 3; ++ d) {
        for (int j = d + 1; j < 3; ++j) {
            anss.push_back({curt, nn[d], nn[j]});
        }
    }
    return anss;
}

// int main() {
// #ifdef DEBUG
//     std::freopen("input.txt", "r", stdin);
// #endif
//     std::cin.tie(0)->std::ios::sync_with_stdio(0);
//     int tt = 1;
//     // std::cin >> tt;
//     while (tt--) {
//         solve();
//     }
// }
