#include "triangles.h"
#include <iostream>
#include <vector>
#include <cstdint>

using namespace std;
std::vector<std::vector<int>> solve(int n) {
    for (int i = 0; i < 4; ++i) {
        vector<Triangle>lf = {Triangle(i, (i + 1)%4, (i+2)%4), Triangle(i, (i + 2)%4, (i+3)%4), Triangle(i, (i + 3)%4, (i+1)%4)};
        vector<Triangle> rt = {Triangle( (i + 1)%4, (i+2)%4, (i+3)%4)};
        if (compare(lf, rt) == 0) {
            return {{i, (i+1)%4, (i+2)%4}, {i, (i+2)%4, (i+3)%4}, {i, (i+3)%4, (i+1)%4}};
        }
    }
    vector<Triangle>lf = {Triangle(0, 1, 2), Triangle(3, 1, 2)};
    vector<Triangle> rt = {Triangle(1, 0, 3), Triangle(2, 0 , 3)};
    if (compare(lf, rt) == 0){
        return {{0, 1, 2},{3, 1, 2}};
    } else {
        lf = {Triangle(0, 1, 2), Triangle(3, 0, 2)};
        rt = {Triangle(1, 0, 3), Triangle(2, 1 , 3)};
        if (compare(lf, rt) == 0) {
            return {{0, 1, 2}, {0, 2, 3}};
        } else {
            return {{0, 1, 2}, {0, 1, 3}};
        }
    }
}