#include "triangles.h"

std::vector<std::vector<int>> solve(int n) {
    std::vector<std::vector<int>> ans;
   // int answ = compare({Triangle(0,1, 2), Triangle(1,2,3)},{Triangle(0,1,3),Triangle(0, 2,3)});
    int a1 = compare({Triangle(0,1,2),Triangle(0,1,3),Triangle(0,2,3)},{Triangle(1,2,3)});
    int a2 =  compare({Triangle(0,1,2),Triangle(0,1,3),Triangle(1,2,3)},{Triangle(0,2,3)});
    int a3 = compare({Triangle(0, 1, 2),Triangle(1, 2,3),Triangle(0, 2,3)},{Triangle(0, 1, 3)});
    int a4 = compare({Triangle(0, 1, 3),Triangle(1, 2, 3), Triangle(0,2,3)},{Triangle(0,1,2)});
    if (a1 == 0) {
        ans.push_back({0, 1, 2});
        ans.push_back({0, 1, 3});
        ans.push_back({0, 2, 3});
    }
    else if (a2==0) {
        ans.push_back({0, 1, 2});
        ans.push_back({0, 1, 3});
        ans.push_back({1, 2, 3});
    }
    else if (a3==0) {
        ans.push_back({0, 1, 2});
        ans.push_back({1, 2, 3});
        ans.push_back({0, 2, 3});
    }
    else if (a4==0){
        ans.push_back({0, 1, 3});
        ans.push_back({1, 2, 3});
        ans.push_back({0, 2, 3});
    }
    else {
        int b2 = compare({Triangle(0,1,2),Triangle(0,2,3)},{Triangle(0,1,3), Triangle(1,2,3)});
        int b1 = compare({Triangle(0,1,2),Triangle(1,2,3)},{Triangle(0,1,3),Triangle(0, 2,3)});
        if (b2==0) {
            ans.push_back({0,1, 3});
            ans.push_back({1, 2, 3});
        }
       else if (b1 == 0) {
            ans.push_back({0,1,2});
            ans.push_back({1,2,3});
        } else {
            return {};
        }
    }
    return ans;
}