#include<vector>

using namespace std;

std::vector<int> solve(std::vector<int> A) {

    vector<int> sol;
    int csum;

    int N = A.size();
    int SUM = (1 + N) * N/2;


    for (int x = N/2 - 1; x>=0; x--) {
        sol.push_back(N-x);
        csum += (N-x);
        if (csum >= SUM/2) {break;}
        sol.push_back(x+1);
        csum += (x+1);
        if (csum >= SUM/2) {break;}
    }

    return sol;
};
