#include <bits/stdc++.h>
#include "triangles.h"
using namespace std;
using ll = long long;

# define ff first
# define ss second

const ll mod = 998244353;
ll mult(ll a, ll b) {
    return a * b % mod;
}

ll add(ll a, ll b) {
    return (a + b) % mod;
}

ll binpow(ll a, ll p) {
    ll ans = 1;
    while (p) {
        if (p & 1) ans = mult(ans, a);
        a = mult(a, a);
        p /= 2;
    }
    return ans;
}

std::vector<std::vector<int>> solve(int n) {
    vector<vector<int>> t;
    for (ll i = 0; i < n; ++i) {
        for (ll j = i + 1; j < n; ++j) {
            for (ll k = j + 1; k < n; ++k) {
                t.push_back({i, j, k});
            }
        }
    }
    sort(t.begin(), t.end(), [&](const vector<ll>& a, const vector<ll>& b) {
        ll pon = compare({Triangle(a[0], a[1], a[2])}, {Triangle(b[0], b[1], b[2])});
        return pon == 1;
    });
    vector<vector<int>> ans;
    ans.push_back(t[0]);
    for (ll i = 1; i < n; ++i) {
        ll cnt = 0;
        for (ll j = 0; j < 3; ++j) {
            if (ans[0][j] == t[i][j]) {
                cnt++;
            }
        }
        if (cnt >= 2) {
            ans.push_back(t[i]);
            break;
        }
    }
    return ans;
} 