#include <bits/stdc++.h>
using namespace std;
int t, n;
vector <int> solve(vector <int> a){
	vector <int> v;
	vector <int> v1[30000001];
	for (int i = 0; i < 30000001; i++)
		v1[i].clear();
	for (int i = 0; i < a.size(); i++)
		v1[a[i]].push_back(i);
	for (int i = 1; i < 30000000; i++){
		if (v1[i].size() != 0)
			for (int j = 0; j < v1[i].size() / 2; j++)
				v.push_back(v1[i][j]);
	}
	for (int i = 1; i < 30000000; i++){
		if (v1[i].size() != 0)
		for (int j = v1[i].size() / 2; j < v1[i].size(); j++)
			v.push_back(v1[i][j]);
	}
	/*for (int i = 0; i < (a.size() - 1) / 2; i++)
		v.push_back(i);
	v.push_back(a.size() - 1);
	for (int i = (a.size()  - 1) / 2; i < a.size() - 1; i++)
	v.push_back(i);
	return v;*/
	return v;
}
/* int main(){
	cin >> t;
	while (t--){
		cin >> n;
		vector <int> x;
		for (int i = 0; i < n; i++){
			int p;
			cin >> p;
			x.push_back(p);
		}
		for (int i = 0; i < n; i++)
			cout << solve(x)[i] << " ";
		cout << endl;
	}
}*/
