#include <bits/stdc++.h>
using namespace std;
std::vector<int> solve(std::vector<int> A)
{
    if(A.size() == 1)return {0};
    vector < pair <int, int> > v;
    for(int i = 0; i < A.size(); i++)
    {
        v.push_back({A[i], i});
    }
    vector <int> ans;
    int c = v.size()/2-1;
    if(v.size()%2 == 0)c--;
    if(v.size() == 2)return {v[1].second, v[0].second};
    for(int i = 0; i <= c; i++)
        ans.push_back(v[i].second);
    ans.push_back(v[v.size()-1].second);
    for(int i = c+1; i < v.size()-1; i++)
    {
        ans.push_back(v[i].second);
    }
    return ans;
}
