#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back
using namespace std;

std::vector<int> solve(std::vector<int> A) {
    int n = A.size();
    vector <int> ans(n);
    int l = 0, r = n - 1;
    for (int i = 0; i + 1 < n; i += 2) {
        ans[i] = r; ans[i + 1] = l;
        l++; r--;
    }
    if (l == r) ans[n - 1] = l;
    return ans;
}
