#include<bits/stdc++.h>
using namespace std;
#include "triangles.h"
int N;
bool cmp(int a, int b) {
    vector<Triangle>e1 = {{0, a, b}};
    vector<Triangle>e2 = {{N - 1, a, b}};
    return (compare(e1, e2) == 1);
}
std::vector<std::vector<int>> solve(int n) {
    N = n;
    vector<int>p(n);
    iota(p.begin(), p.end(), 0);
    sort(p.begin() + 1, p.end() - 1, cmp);
    vector<vector<int> >ans;
    for (int i = 1; i < n - 1; i++) {
        ans.push_back({0, p[i], p[i + 1]});
    }
    return {p};
}
