#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n < 4) {
      cout << "-1" << endl;
      continue;
    }
    long long int a[4] = {2, 4, 1, 3};
    long long int ans = n / 4;
    long long int ans1 = n % 4;
    if (ans1 == 0 || ans1 == 1) {
      for (long long int i = (0); i < (ans); i++)
        for (long long int j = (0); j < (4); j++) cout << a[j] + i * 4 << " ";
      if (ans1 == 1) cout << n;
      cout << endl;
    } else {
      if (ans1 == 2) {
        long long int b[6] = {1, 4, 2, 5, 3, 6};
        for (long long int i = (0); i < (ans - 1); i++)
          for (long long int j = (0); j < (4); j++) cout << a[j] + i * 4 << " ";
        for (long long int i = (0); i < (6); i++)
          cout << b[i] + (ans - 1) * 4 << " ";
      } else {
        long long int b[7] = {1, 3, 7, 4, 6, 2, 5};
        for (long long int i = (0); i < (ans - 1); i++)
          for (long long int j = (0); j < (4); j++) cout << a[j] + i * 4 << " ";
        for (long long int i = (0); i < (7); i++)
          cout << b[i] + (ans - 1) * 4 << " ";
      }
      cout << endl;
    }
  }
  return 0;
}
