#include "triangles.h"

#include <bits/stdc++.h>

using namespace std;

std::vector<std::vector<int>> solve(int n) {
    for (int i = 0; i < 4; i++) {
        vector<int> a;
        for (int j = 0; j < 4; j++) if (j != i) a.push_back(j);
        int res = compare({{a[0], a[1], a[2]}}, {{a[0], a[1], i}, {a[1], a[2], i}, {a[2], a[0], i}});
        if (res == 0) {
            vector<vector<int>> ans = {{a[0], a[1], i}, {a[1], a[2], i}, {a[2], a[0], i}};
            return ans;
        }
    }
    vector<int> por(4);
    for (int i = 0; i < 4; i++) por[i] = i;
    while (true) {
        int res = compare({{por[0], por[1], por[3]}, {por[1], por[2], por[3]}}, {{por[0], por[1], por[2]}, {por[0], por[2], por[3]}});
        if (res == 0) {
            return {{por[0], por[1], por[3]}, {por[1], por[2], por[3]}};
        }
        next_permutation(por.begin(), por.end());
    }
}
