#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin >> T;
while (T--){
int N;
cin >> N;
// Small special‐cases
if (N == 1) {
cout << "1\n";
continue;
}
if (N <= 4) {
cout << "-1\n";
continue;
}
vector<int> ans;
ans.reserve(N);
vector<bool> used(N+1,false);
// We'll start with an even; you can also try starting with an odd.
int parity = 0; // 0 = even, 1 = odd
bool ok = true;
for (int pos = 0; pos < N; pos++, parity ^= 1) {
bool placed = false;
// scan numbers of the required parity
for (int x = (parity==0 ? 2 : 1); x <= N; x += 2) {
if (used[x]) continue;
if (pos > 0) {
int prev = ans[pos-1];
// abs difference must exceed 1
if (abs(prev - x) <= 1)
continue;
}
// place x
used[x] = true;
ans.push_back(x);
placed = true;
break;
}
if (!placed) {
ok = false;
break;
}
}
if (!ok || (int)ans.size() != N) {
cout << "-1\n";
} else {
for (int i = 0; i < N; i++) {
if (i) cout << ' ';
cout << ans[i];
}
cout << "\n";
}
}
return 0;
}