#include <bits/stdc++.h>
//#define int long long
#define pb push_back
#define fs first
#define sc second
using namespace std;

vector<int> solve(vector<int> a) {
    int n = a.size();
    vector<int> res;
    for (int i = 1; i < n; i+=2) res.pb(i);
    if (n % 2 == 1) res.pb(n - 1);
    for (int i = 0; i < n-1; i+=2) res.pb(i);
    return res;
}
// signed main() {
//     vector<int> a = {1, 2, 3, 4, 5, 6, 7, 8};
//     vector<int> res = solve(a);
//     for (auto u:res) cout << u << " ";
// }