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

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

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

vector<vector<int>> solve(int n) {
    vector<int> p{0, 1, 2, 3};
    do {
        int i = p[0], j = p[1], o = p[2], k = p[3];
        Triangle A(i, o, k), B(i, o, j), C(j, o, k), D(j, k, i);
        if (compare({A}, {B, D, C}) == 0) {
            return {{i, o, j}, {j, o, k}, {k, j, i}};
        }
    } while (next_permutation(all(p)));
    do {
        int i = p[0], j = p[1], o = p[2], k = p[3];
        Triangle A(i, o, j), B(i, o, k);
        Triangle C(j, k, i), D(j, k, o);
        if (compare({A, B}, {C, D}) == 0) {
            return {{i, o, j}, {i, o, k}};
        }
    } while (next_permutation(all(p)));
}