#include <bits/stdc++.h>
const long long LINF = 1e18;
const int INF = 1e9;
const int M = 1e9 + 7;
const double EPS = 1.0e-9;
const double PI = acos(-1.0);
using namespace std;
void solve() {
  int n;
  cin >> n;
  if (n < 4) {
    cout << "-1\n";
    return;
  }
  int mult = 0;
  for (int i = 0; i < n / 4 - 1; i++) {
    cout << mult + 2 << " " << mult + 4 << " " << mult + 1 << " " << mult + 3
         << " ";
    mult += 4;
  }
  n = n % 4 + 4;
  if (n == 4) {
    cout << mult + 2 << " " << mult + 4 << " " << mult + 1 << " " << mult + 3
         << " ";
  }
  if (n == 5) {
    cout << mult + 1 << " " << mult + 3 << " " << mult + 5 << " " << mult + 2
         << " " << mult + 4;
  }
  if (n == 6) {
    cout << mult + 1 << " " << mult + 3 << " " << mult + 5 << " " << mult + 2
         << " " << mult + 4 << " " << mult + 6;
  }
  if (n == 7) {
    cout << mult + 1 << " " << mult + 3 << " " << mult + 5 << " ";
    cout << mult + 2 << " " << mult + 6 << " " << mult + 4 << " " << mult + 7;
  }
  cout << "\n";
}
int main() {
  std::ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) solve();
  return 0;
}
