#include "partition.h"
#include <algorithm>
#include <cmath>
#include <vector>
#include <cassert>

using namespace std;
const int N = 2e6 + 67;
typedef long long ll;

#define all(X) (X).begin(), (X).end()
#define ff first
#define ss second

bool used[N];
pair<int, int>a[N];

std::vector<int> solve(std::vector<int> A) 
{
	int n = A.size();
	ll S = 0;
	for (int i = 0; i < n; i++) {
		S += 1ll * A[i];
	}
	vector<int>answ;
	for(int i = 0;i < n;i)
	{
		if (i < n - i + 1) {
			answ.push_back(i);
			answ.push_back(n - i - 1);
			i += 2;
		}
		else
			break;
	}
	vector<bool>vis(n, false);
	for (auto i : answ)
	{
		vis[i] = true;
	}
	for (int i = 0; i < n; i++)
		if (!vis[i])
			answ.push_back(i);
	return answ;
}
