#include "triangles.h"
#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> con(vector<Triangle> a) {
    vector<vector<int>> res;
    for (auto to : a) {
        vector<int> cur;
        cur.push_back(to.i);
        cur.push_back(to.j);
        cur.push_back(to.k);
        res.push_back(cur);
    }
    return res;
}

vector<vector<int>> solve(int n) {
    vector<vector<int>> res;
    vector<Triangle> a1 = {{0, 1, 2}, {0, 1, 3}};
    vector<Triangle> a2 = {{0, 2, 1}, {0, 2, 3}};
    vector<Triangle> a3 = {{0, 3, 2}, {0, 3, 1}};

    if (compare(a1, a2) == -1) {
        if (compare(a1, a3) == -1) {
            return con(a1);
        } else {
            return con(a3);
        }
    } else {
        if (compare(a2, a3) == -1) {
            return con(a2);
        } else {
            return con(a3);
        }
    }
}