#include <bits/stdc++.h>
//#include "grader.cpp"
//#include "partition.h"
using namespace std;

// maxsum

std::vector<int> solve(std::vector<int> A)
{
    const int maxN = 5e6 + 5;
    vector <int> ans;
    //vector <int> can(maxN);
    //vector <int> br(maxN);
    vector <bool> used(maxN);
    sort(A.begin(), A.end());
    int n = A.size();
    int sumAll = 0;
    for (int i = 0; i < n; i++)
    {
        sumAll += A[i];
    }
    for (int i = n / 2; i < n; i++)
    {
        ans.push_back(i);
    }
    for (int i = 0; i < n / 2; i++)
    {
        ans.push_back(i);
    }
    return ans;
}
