#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) {
    for (int i = 0; i < 4; ++i)
    {
        for (int j = 0; j < 4; ++j)
        {
            if (i == j) continue;
            set<int> st = {0, 1, 2, 3};
            st.erase(i);
            st.erase(j);
            int v = *st.begin(), u = *(++st.begin());
            vector<Triangle> left = {Triangle(i, j, v), Triangle(i, j, u)};
            vector<Triangle> right = {Triangle(v, u, i), Triangle(v, u, j)};
            int res = compare(left, right);
            if (res == 0)
            {
                return {{i, j, v}, {i, j, u}};
            }
        }
    }
    int i = 0;
    int mx = 1;
    for (int j = 2; j < 4; ++j)
    {
        auto a = f({1, 2, 3}, mx);
        auto b = f({1, 2, 3}, j);
        vector<Triangle> left = {Triangle(a[0], a[1], 0)};
        vector<Triangle> right = {Triangle(b[0], b[1], 0)};
        int res = compare(left, right);
        if (res < 0)
        {
            mx = j;
        }
    }
    auto a = f({1, 2, 3}, mx);
    vector<Triangle> left = {Triangle(0, mx, a[0]), Triangle(0, mx, a[1])};
    vector<Triangle> right = {Triangle(0, a[1], a[0]), Triangle(mx, a[0], a[1])};
    int res = compare(left, right);
    throw(0);
    if (res < 0)
    {
        return {{0, mx, a[0]}, {0, mx, a[1]}};
    }
    return {{0, a[0], a[1]}, {mx, a[0], a[1]}};
}
