/*
  _      __        __         __        ____                    ___    _                   __
 | | /| / / ___ _ / /_ ____  / /       / __ \  ___  ___        / _ \  (_) ___  ____ ___   / /
 | |/ |/ / / _ `// __// __/ / _ \     / /_/ / / _ \/ -_)      / ___/ / / / -_)/ __// -_) /_/ 
 |__/|__/  \_,_/ \__/ \__/ /_//_/     \____/ /_//_/\__/      /_/    /_/  \__/ \__/ \__/ (_)  
                                                                                             
*/
 
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include "partition.h"
#define ll long long
#define ld long double
#define all(v) v.begin(), v.end()
#define allr(v, l, r) v.begin() + l, v.begin() + r;
#define endl "\n"
#define newline cout << endl;
using namespace std;

// constants
const int INF = 1e9;

// functions

// structs

// globals

// notes
/*
 -stuff you should look for-
* int overflow, array bounds
* special cases (n=1?)
* do something instead of nothing and stay organized
* WRITE STUFF DOWN
* DON'T GET STUCK ON ONE APPROACH

continue - skip the rest in the loop
*/

vector <int> solve(vector<int> A)
{
    int n = (int)A.size();
    
    vector <int> type(n + 1);
    if (n % 4 == 0)
    {
        for (int i = 3; i < n; i += 4)
        {
            type[i] = type[i - 3] = 0;
            type[i - 1] = type[i - 2] = 1;
        }
    }    
    else if (n % 4 == 1)
    {
        for (int i = 3; i < n - 1; i += 4)
        {
            type[i] = type[i - 1] = 0;
            type[i - 2] = type[i - 3] = 1;
        }
    }
    else if (n % 4 == 2)
    {
        for (int i = 3; i < n - 2; i += 4)
        {
            type[i] = type[i - 1] = 0;
            type[i - 2] = type[i - 3] = 1;
        }
    }
    else
    {
        for (int i = 3; i < n - 1; i += 4)
        {
            type[i] = type[i - 1] = 0;
            type[i - 2] = type[i - 3] = 1;
        }
    }
    
    vector <int> res;
    for (int c = 0; c < 2; c++)
    {
        for (int i = 0; i < n; i++)
        {
            if (type[i] == c)
            {
                res.push_back(i);
            }
        }
    }
    
    return res;
}

/*
$$$$$$$$\ $$$$$$$$\ 
$$  _____|\____$$  |
$$ |          $$  / 
$$$$$\       $$  /  
$$  __|     $$  /   
$$ |       $$  /    
$$$$$$$$\ $$$$$$$$\ 
\________|\________|
*/