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

vector <vector <int>> solve(int n) {
    assert(n == 4);

    Triangle ABC(0, 1, 2);
    Triangle ABD(0, 1, 3);
    Triangle ACD(0, 2, 3);
    Triangle BCD(1, 2, 3);

    if (compare({ABC}, {ABD, ACD, BCD}) == 0) {
        return {{3, 0, 1}, {3, 1, 2}, {3, 2, 1}};
    }

    if (compare({ABD}, {ABC, ACD, BCD}) == 0) {
        return {{2, 0, 1}, {2, 1, 3}, {2, 3, 0}};
    }

    if (compare({ACD}, {ABD, ABC, BCD}) == 0) {
        return {{1, 0, 2}, {1, 2, 3}, {1, 3, 0}};
    }

    if (compare({BCD}, {ABD, ACD, ABC}) == 0) {
        return {{0, 1, 2}, {0, 2, 3}, {0, 3, 1}};
    }

    if (compare({ABC, ACD}, {BCD, ABD}) == 0) {
        return {{0, 1, 2}, {0, 3, 2}};
    }

    if (compare({ABC, ABD}, {ACD, BCD}) == 0) {
        return {{0, 1, 2}, {0, 1, 3}};
    }

    return {{0, 3, 1}, {0, 3, 2}};
}
