#include <bits/stdc++.h>
using namespace std;
int t, n;
vector <int> solve(vector <int> a){
	vector <int> v;
	v.clear();
	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;
}
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;
	}
}

