#include "triangles.h"
#include "vector"
#include "algorithm"

std::vector<std::vector<int>> solve(int n) {
    std::vector<std::vector<int>> p(24);
    std::vector<int> cur{0, 1, 2, 3};
    int it = 0;
    do{
        p[it] = cur;
        ++it;
    }while(std::next_permutation(cur.begin(), cur.end()));
    std::vector<std::vector<int>> ans;
    for(auto &i : p){
        std::vector<Triangle> left = {{i[0], i[1], i[2]}};
        std::vector<Triangle> right = {{i[0], i[1], i[3]}, {i[0], i[2], i[3]}, {i[1], i[2], i[3]}};
        if (compare(left, right) == 0) {
            ans = {{i[0], i[1], i[3]}, {i[0], i[2], i[3]}, {i[1], i[2], i[3]}};
        }
    }
    for(auto &i : p){
        std::vector<Triangle> left = {{i[0], i[1], i[2]}, {i[0], i[2], i[3]}};
        std::vector<Triangle> right = {{i[0], i[2], i[3]}, {i[0], i[1], i[2]}};
        if (compare(left, right) == 0){
            ans = {{i[0], i[1], i[2]}, {i[1], i[2], i[3]}};
        }
    }
    return ans;
}