#include <bits/stdc++.h>
using namespace std;
long long powmod(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent) {
    if (exponent & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    exponent /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
const int upperlimit = 1e6 + 100;
const int mod = 1e9 + 7;
int a1[4] = {2, 4, 1, 3};
int a2[5] = {1, 3, 5, 2, 4};
int a3[6] = {1, 3, 5, 2, 4, 6};
int a4[7] = {1, 3, 5, 2, 6, 4, 7};
int main() {
  int t, n;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    if (n <= 3) {
      printf("%d\n", -1);
      continue;
    }
    int k = n - 4 - (n % 4);
    for (int i = 0; i < k; i++) printf("%d ", i - (i % 4) + (a1[i % 4]));
    if (n % 4 == 0) {
      for (int i = k; i < n; i++) printf("%d ", k + a1[i - k]);
    }
    if (n % 4 == 1) {
      for (int i = k; i < n; i++) printf("%d ", k + a2[i - k]);
    }
    if (n % 4 == 2) {
      for (int i = k; i < n; i++) printf("%d ", k + a3[i - k]);
    }
    if (n % 4 == 3) {
      for (int i = k; i < n; i++) printf("%d ", k + a4[i - k]);
    }
    printf("\n");
  }
  return 0;
}
