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

using namespace std;

std::vector<std::vector<int>> solve(int n) {
    vector<int> v{0, 1, 2, 3};
    for (int i = 0; i < 24; i++) {
        next_permutation(v.begin(), v.end());
        vector<Triangle> ask1 = {Triangle(v[0], v[1], v[2]), Triangle(v[2], v[3], v[0])};
        vector<Triangle> ask2 = {Triangle(v[1], v[2], v[3]), Triangle(v[3], v[0], v[1])};
        int compare_result = compare(ask1, ask2);
        if (compare_result == 0) {
            return {{v[0], v[1], v[2]}, {v[2], v[3], v[0]}};
        }
        ask1 = {Triangle(v[0], v[1], v[3]), Triangle(v[1], v[2], v[3]), Triangle(v[0], v[2], v[3])};
        ask2 = {Triangle(v[0], v[1], v[2])};
        compare_result = compare(ask1, ask2);
        if (compare_result == 0) {
            return {{v[0], v[1], v[2]}};
        }
    }
}
