#include "triangles.h"
#pragma GCC optimize("Ofast,unroll-loops")
#pragma GCC target("avx2,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

std::vector<std::vector<int>> solve(int n) {
    int center = -1;
    for (ll i = 0; i < n; i++) {
        vector<ll> v(n);
        iota(v.begin(), v.end(), 0);
        v.erase(v.begin() + i);
        vector<Triangle> left = {Triangle(v[0], v[1], v[2])};
        vector<Triangle> right = {Triangle(v[0], v[1], i), Triangle(v[0], v[2], i), Triangle(v[1], v[2], i)};
        int res = compare(left, right);
        if (res == 0) {
            center = i;
            return;
        }
    }
    if (center == -1) {
        return {{0, 1, 2}, {0, 2, 3}};
    } else {
        vector<vector<int>> ans;
        for (int i = 0; i < n; i++) {
            for (int j = i+1; j < n; j++) {
                if (i !=j && i != center) {
                    ans.push_back({i, center, j});
                }
            }
        }
        return ans;
    }
}
