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

using namespace std;

//#define int long long
#define db double
#define ll long long
#define pii pair<int, int>
#define tiii tuple<int ,int, int >
#define tiiii tuple<int, int, int, int>
#define tiiiii tuple<int, int, int, int, int>
#define ve vector
#define vi ve<int>
#define vvi ve<vi>
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)
#define cin(a) for(auto &now : a) cin >> now;
#define print(a, s) for(auto now : a) cout << now << s;
mt19937 rnd(time(0));


int compare(const std::vector<Triangle>& left, const std::vector<Triangle>& right);
#define vet ve<Triangle>
#define tr Triangle

vvi solve(int n) {
	int mx = 2;
	for (int i = 3; i < n; ++i) {
		int res = compare(vet{ tr(0, 1, i) }, vet{ tr(0, 1, mx) });
		if (res == 1) mx = i;
	}
	int mx2 = 1;
	for (int i = 2; i < n; ++i) {
		if (i == mx) continue;
		int res = compare(vet{ tr(0, mx, i) }, vet{ tr(0, mx, mx2) });
		if (res == 1) mx2 = i;
	}
	int mx3 = 0;
	for (int i = 1; i < n; ++i) {
		if (i == mx || i == mx2) continue;
		int res = compare(vet{ tr(mx, mx2, i) }, vet{ tr(mx, mx2, mx3) });
		if (res == 1) mx3 = i;
	}
	return vvi{ vi{mx, mx2, mx3} };
	
}

