// #define _GLIBCXX_DEBUG
// #pragma GCC optimize("O3,unroll-loops")
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include "triangles.h"

// struct Triangle {
//     int i, j, k;
//     Triangle() = default;
//     Triangle(int i_, int j_, int k_) : i(i_), j(j_), k(k_) {}
// };
using namespace std;
using ll = int;
using ld = long double;

vector<vector<int>> solve(int n){
    int t;
    for (ll i = 0; i<=3; i++){
        t = 0;
        vector<int> ost;
        for (int j = 0; j<4; j++){
            if (i == j){continue;}
            ost.push_back(j);
        }
        t += compare(vector<Triangle> {Triangle(ost[0], ost[1], ost[2])}, vector<Triangle>{Triangle(i, ost[0], ost[1])});
        t += compare(vector<Triangle> {Triangle(ost[0], ost[1], ost[2])}, vector<Triangle>{Triangle(i, ost[2], ost[1])});
        t += compare(vector<Triangle> {Triangle(ost[0], ost[1], ost[2])}, vector<Triangle>{Triangle(i, ost[0], ost[2])});
        if (t == 3){
            return vector<vector<int>> {{ost[0], ost[1], i}, {ost[0], ost[2], i}, {ost[1], ost[2], i}};
        }
    }
    t = compare(vector<Triangle> {Triangle(0, 1, 2), Triangle(0, 3, 2)}, vector<Triangle>{Triangle(1, 2, 3), Triangle(1, 0, 3)});
    if (t == 0){
        vector<vector<int>> ans = {{0, 1, 2}, {0, 3, 2}};
        return ans;
    }
    t = compare(vector<Triangle> {Triangle(0, 3, 1), Triangle(0, 3, 2)}, vector<Triangle>{Triangle(1, 2, 3), Triangle(1, 0, 2)});
    if (t == 0){
        vector<vector<int>> ans = {{0, 1, 3}, {0, 3, 2}};
        return ans;
    }
}