vector<vector<int>> solve(int n) {
    ll mn = 0, f = -1;
    vector<vector<Triangle>> v(n);
    vector<Triangle> t;
    ll mx = -1;
    for (int i = 0; i < n; ++i) {
        for (int j = i + 1; j < n; ++j) {
            for (int k = j + 1; k < n; ++k) {
                if (mx != -1) {
                    if (compare(t[mx], {Triangle{i, j, k}}) == -1) {
                        mx = t.size();
                    }
                } else {
                    mx = 0;
                }
                t.push_back(Triangle{i, j, k});
            }
        }
    }
    for (int i = 0; i < n; ++i) {
        vector<Triangle> cur;
        for (int j = 0; j < n; ++j) {
            if (j == i) {
                continue;
            }
            for (int k = 0; k < n; ++k) {
                if (k == i || k == j) {
                    continue;
                }
                cur.push_back(Triangle{0, 1, 2});
            }
        }
        if (i != 0) {
            ll x = compare(t[mx], cur);
            if (x == 0) {
                mn = i;
                f = 1;
            }
        }
        v[i] = cur;
    }
    if (f == 1) {
        cout << v[mn].size() << '\n';
        for (Triangle i : v[mn]) {
            cout << 3 << '\n' << i.i << ' ' << i.j << ' ' << i.k << '\n';
        }
    } else {

    }
}