#include "triangles.h"
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <deque>
#include <queue>
#include <random>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <numeric>
#include <cmath>

using namespace std;
using ll = long long;
using ld = long double;
//111
const int inf = 1e9 + 7;
const ll INF = 4e18;
const ll MOD = 998'244'353;

//struct Triangle {
//    int i, j, k;
//
//    Triangle() = default;
//    Triangle(int i_, int j_, int k_) : i(i_), j(j_), k(k_) {}
//};
//
//int compare(const std::vector<Triangle>& left, const std::vector<Triangle>& right);


vector<vector<int>> solve(int n) {
    int f0 = compare({Triangle(1, 2, 3)}, {Triangle(0, 1, 2), Triangle(0, 1, 3), Triangle(0, 2, 3)});
    if (f0 == 0) {
        return {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}};
    }
    int f1 = compare({Triangle(0, 2, 3)}, {Triangle(0, 1, 2), Triangle(0, 1, 3), Triangle(1, 2, 3)});
    if (f1 == 0) {
        return {{0, 1, 2}, {0, 1, 3}, {1, 2, 3}};
    }
    int f2 = compare({Triangle(0, 1, 3)}, {Triangle(0, 1, 2), Triangle(0, 2, 3), Triangle(1, 2, 3)});
    if (f2 == 0) {
        return {{0, 1, 2}, {0, 2, 3}, {1, 2, 3}};
    }
    int f3 = compare({Triangle(0, 2, 1)}, {Triangle(0, 3, 2), Triangle(0, 1, 3), Triangle(1, 2, 3)});
    if (f3 == 0) {
        return {{0, 3, 2}, {0, 1, 3}, {1, 2, 3}};
    }
    int f = compare({Triangle(0, 1, 3), Triangle(0, 1, 2)}, {Triangle(2, 3, 0), Triangle(1, 2, 3)});
    if (f == 0) {
        return {{0, 3, 1, 2}};
    }
    f = compare({Triangle(0, 2, 1), Triangle(0, 2, 3)}, {Triangle(1, 3, 0), Triangle(1, 3, 2)});
    if (f == 0) {
        return {{0, 1, 2, 3}};
    }
    f = compare({Triangle(0, 3, 1), Triangle(0, 3, 2)}, {Triangle(0, 1, 2), Triangle(1, 2, 3)});
    if (f == 0) {
        return {{0, 1, 3, 2}};
    }
}