#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
void solve() {
  int n;
  cin >> n;
  int org = n;
  if (n < 4) {
    cout << -1 << "\n";
    return;
  }
  map<int, vector<int> > mp;
  mp[4] = {2, 4, 1, 3};
  mp[5] = {1, 3, 5, 2, 4};
  mp[6] = {1, 5, 3, 6, 4, 2};
  mp[7] = {1, 4, 7, 3, 6, 2, 5};
  n -= 4;
  int mul = n / 4;
  for (long long i = 0; i < mul * 4; i++) {
    int op = (4 * (i / 4)) + mp[4][i % 4];
    cout << op << " ";
  }
  int diff = org - (mul * 4);
  for (int x : mp[diff]) {
    cout << mul * 4 + x << " ";
  }
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
