#include "triangles.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<std::vector<int>> solve(int n) {

    std::vector<Triangle> left = {Triangle(0, 1, 2), Triangle(0, 2, 3), Triangle(0, 1, 3)};
    std::vector<Triangle> right = {Triangle(1, 2, 3)};
    int compare_result = compare(left, right);
    if (compare_result == 0) {
        return {{0, 1, 2}, {0, 2, 3}, {0, 1, 3}};
    }
    left = {Triangle(1, 2, 3), Triangle(1, 0, 2), Triangle(1, 0, 3)};
    right = {Triangle(0, 2, 3)};
    compare_result = compare(left, right);
    if (compare_result == 0) {
        return {{3, 1, 2}, {1, 0, 2}, {0, 1, 3}};
    }

    left = {Triangle(2, 1, 3), Triangle(1, 0, 2), Triangle(2, 0, 3)};
    right = {Triangle(1, 0, 3)};
    compare_result = compare(left, right);
    if (compare_result == 0) {
        return {{3, 1, 2}, {1, 0, 2}, {0, 2, 3}};
    }

    left = {Triangle(1, 2, 3), Triangle(1, 0, 3), Triangle(2, 0, 3)};
    right = {Triangle(0, 1, 2)};
    compare_result = compare(left, right);
    if (compare_result == 0) {
        return {{3, 1, 2}, {1, 0, 3}, {0, 2, 3}};
    }
    left = {Triangle(0, 1, 2), Triangle(0, 1, 3)};
    right = {Triangle(2, 3, 0), Triangle(2, 3, 1)};
    int compare_result1 = compare(left, right);

    left = {Triangle(1, 3, 0), Triangle(1, 3, 2)};
    right = {Triangle(0, 2, 1), Triangle(0, 2, 3)};
    int compare_result2 = compare(left, right);

    left = {Triangle(1, 2, 0), Triangle(1, 2, 3)};
    right = {Triangle(0, 3, 2), Triangle(0, 3, 1)};
    int compare_result3 = compare(left, right);
    if (compare_result1 == 0) {
        return {{0, 1, 2}, {0, 1, 3}};
    }
    if (compare_result2 == 0) {
        return {{1, 3, 0}, {1, 3, 2}};
    }
    return {{1, 2, 0}, {1, 2, 3}};


}