#include "triangles.h"
#include <iostream>

std::vector<std::vector<int>> solve(int n){
    int a = 0, b = 1, c = 2, d = 3;
    for(int a = 0; a < n; a++){
        for(int b = 0; b < n; b++){
            if(b == a){
                continue;
            }
            for(int c = 0; c < n; c++){
                if(c == a || c == b){
                    continue;
                }
                int d = 6 - a - b - c;
                int cmp = compare({Triangle(a, b, c)}, {Triangle(a, b, d)});
                if(cmp == -1){
                    continue;
                }
                int cmp2 = compare({Triangle(a,b,c)}, {Triangle(a,b,d),Triangle(a,c,d), Triangle(c, d, b)});
                if(cmp2 == 0){
                    return {{a, b, c}};
                }
            }
        }
    }
    for(int a = 0; a < n; a++){
        for(int b = 0; b < n; b++){
            if(b == a){
                continue;
            }
            for(int c = 0; c < n; c++){
                if(c == a || c == b){
                    continue;
                }
                int d = 6 - a - b - c;
                int ask = compare({Triangle(a, c, b), Triangle(a, d, b)}, {Triangle(a, c, d), Triangle(b, d, c)});
                if(ask != 0){
                    return {{a, b, c}, {c, d, a}};
                }
            }
        }
    }
    return {{a, d, c}, {b, c, a}};
} 