#include <bits/stdc++.h>
int counting_sort[30000005];
using namespace std;
vector <int> ez_points(vector <int> z)
{
    int n = z.size();
    vector <int> ans;
    if(n % 2 == 0)
    {
        for(int i = 0;i < n / 2;i++)
        {
            ans.push_back(n - i - 1);
            ans.push_back(i);
        }
    }
    else
    {
        for(int i = 0;i < n / 2;i++)
        {
            ans.push_back(n - i - 1);
            ans.push_back(i);
        }
        ans.push_back(n / 2);
    }
    return ans;
}
vector <int> more_ez_points(vector <int> z)
{
    int n = z.size();
    sort(z.begin() , z.end());
    vector <int> ans;
    for(int i = 0;i < n;i+= 2)
    {
        ans.push_back(z[i]);
    }
    for(int i = 1;i < n;i += 2)
    {
        ans.push_back(z[i]);
    }
    return ans;
}
vector <int> solve(vector <int> z)
{
    int n = z.size();
    for(int i = 0;i < n;i++)
    {
        if(z[i] == i + 1)continue;
        else
        {
            return more_ez_points(z);
        }
    }
    return ez_points(z);
}
