#include "triangles.h"
#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
#define len(v) (int)v.size()

using namespace std;
using ll = long long;
using ld = long double;

vector<int> f(vector<int> a, int ban)
{
    vector<int> b;
    for (int x : a)
    {
        if (x == ban) continue;
        b.push_back(x);
    }
    return b;
}

vector<vector<int>> solve(int n) {
    int i = 0, j = 1, k = 2;
    for (int u = 0; u < n; ++u)
    {
        if (u == i || u == j || u == k) continue;
        vector<Triangle> left = {Triangle(i, j, k)};
        vector<Triangle> right = {Triangle(i, j, u)};
        int res = compare(left, right);
        if (res < 0)
        {
            k = u;
        }
    }
    for (int u = 0; u < n; ++u)
    {
        if (u == i || u == j || u == k) continue;
        vector<Triangle> left = {Triangle(i, j, k)};
        vector<Triangle> right = {Triangle(u, j, k)};
        int res = compare(left, right);
        if (res < 0)
        {
            i = u;
        }
    }
    for (int u = 0; u < n; ++u)
    {
        if (u == i || u == j || u == k) continue;
        vector<Triangle> left = {Triangle(i, j, k)};
        vector<Triangle> right = {Triangle(i, u, k)};
        int res = compare(left, right);
        if (res < 0)
        {
            j = u;
        }
    }
    return {{i, j, k}};
}
