
bool operator<(const Triangle &tr1, const Triangle &tr2) {
    return compare({tr1}, {tr2}) == -1;
}
bool operator>(const Triangle &tr1, const Triangle &tr2) {
    return compare({tr1}, {tr2}) == 1;
}

bool operator<(const vector<Triangle> &tr1, const vector<Triangle> &tr2) {
    return compare(tr1, tr2) == -1;
}
bool operator>(const vector<Triangle> &tr1, const vector<Triangle> &tr2) {
    return compare(tr1, tr2) == -1;
}
bool operator==(const vector<Triangle> &tr1, const vector<Triangle> &tr2) {
    return compare(tr1, tr2) == 0;
}

vector<vector<int>> toout(vector<Triangle> trs) {
    vector<vector<int>> res(trs.size());
    for (int i = 0; i < trs.size(); i++) {
        res[i] = {trs[i].i, trs[i].j, trs[i].k};
    }
    return res;
}

std::vector<std::vector<int>> solve(int n) {
    Triangle tr012 = Triangle(0, 1, 2);
    Triangle tr013 = Triangle(0, 1, 3);
    Triangle tr023 = Triangle(0, 2, 3);
    Triangle tr123 = Triangle(1, 2, 3);

    vector<Triangle> triangles = {tr012, tr013, tr023, tr123};

    sort(triangles.begin(), triangles.end(), greater<Triangle>());

    if (vector<Triangle>({triangles[0]}) == vector<Triangle>({triangles[1], triangles[2], triangles[3]})) {
        return toout(vector<Triangle>({triangles[1], triangles[2], triangles[3]}));
    }
    return toout(vector<Triangle>({triangles[0], triangles[2]}));
}