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

using namespace std;

std::vector<std::vector<int>> solve(int n) {
    //vector<pair<Triangle, Triangle>> vars;
    vector<Triangle> vars2 = {Triangle(0, 1, 2), Triangle(0, 1, 3), Triangle(0, 2, 3), Triangle(1, 2, 3)};
    int best = 0;
    for (int i = 1; i < 4; i++) {
        if (compare({vars2[best]}, {vars2[i]}) == -1) {
            best = i;
        }
    }
    int i = vars2[best].i, j = vars2[best].j, k = vars2[best].k;
    int z = 0 + 1 + 2 + 3 - i - j - k;
    if (compare({vars2[best]}, {Triangle(z, i, j), Triangle(z, i, k), Triangle(z, j, k)}) == 0) {
        return {{i, j, z}, {i, k, z}, {j, k, z}};
    }
    //i, j
    if (compare({Triangle(i, j, k), Triangle(j, z, i)}, {Triangle(z, i, k), Triangle(z, k, j)}) == 0) {
        return {{i, z, k}, {z, j, k}};
    }
    //j, k
    if (compare({Triangle(i, j, k), Triangle(j, z, k)}, {Triangle(i, j, z), Triangle(i, z, k)}) == 0) {
        return {{i, j, k}, {j, z, k}};
    }
    //k, i
    if (compare({Triangle(i, j, k), Triangle(i, z, k)}, {Triangle(i, j, z), Triangle(j, z, k)}) == 0) {
        return {{i, j, z}, {j, k, z}};
    }
    /*for (int i = 0; i < 4; i++) {
        for (int j = i + 1; j < 4; j++) {
            vars.push_back({vars2[i], vars2[j]});
        }
    }
    int best = 0;
    for (int i  = 1; i < vars.size(); i++) {
        if (compare({vars[best].first, vars[best].second}, {vars[i].first, vars[i].second}) == -1) {
            best = i;
        }
    }
    return {{vars[best].first.i, vars[best].first.j, vars[best].first.k}, {vars[best].second.i, vars[best].second.j, vars[best].second.k}};*/
}