#include "partition.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> solve(std::vector<int> A) {
    int size = A.size();
    vector<int> res1;
    vector<int> res2;
    if(size % 4 == 0) {

    }
    else if(size % 4 == 1) {
        res1.push_back(0);
    }
    else if(size % 4 == 2) {
        res1.push_back(1);
        res2.push_back(0);
    }
    else {
        res1.push_back(0);
        res1.push_back(1);
        res2.push_back(2);
    }
    int start = size % 4;
    for(int i = start; i < size; i += 4) {
        res1.push_back(i);
    }
    for(int i = start + 1; i < size; i += 4) {
        res2.push_back(i);
    }
    for(int i = start + 2; i < size; i += 4) {
        res2.push_back(i);
    }
    for(int i = start + 3; i < size; i += 4) {
        res1.push_back(i);
    }
    for(auto x : res2) {
        res1.push_back(x);
    }
    return res1;
}
