#include <bits/stdc++.h>
template <typename T>
void read(T &x);
template <typename T>
void read(T &x, T &y);
template <typename T>
void read(T &x, T &y, T &z);
template <typename T>
void write(T x);
template <typename T>
void writeC(T x);
template <typename T>
void writeN(T x);
signed main() {
  int t;
  read(t);
  while (t-- > 0) {
    int n;
    read(n);
    if (n == 2 || n == 3) {
      puts("-1");
      continue;
    } else if (n % 2 == 0) {
      for (int i = 1; i < n / 2 - 1; ++i) printf("%d ", i * 2 - 1);
      printf("%d %d ", n - 1, n - 3);
      for (int i = n / 2; i >= 1; i--) printf("%d ", i * 2);
    } else {
      for (int i = 1; i <= n / 2 + 1; ++i) printf("%d ", i * 2 - 1);
      printf("%d %d ", n - 3, n - 1);
      for (int i = n / 2 - 2; i >= 1; i--) printf("%d ", i * 2);
    }
    puts("");
  }
  return 0;
}
template <typename T>
void read(T &x) {
  x = 0;
  char c = getchar();
  T flag = 1;
  while (c < '0' || c > '9') {
    if (c == '-') flag = -flag;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= flag;
}
template <typename T>
void read(T &x, T &y) {
  read(x);
  read(y);
}
template <typename T>
void read(T &x, T &y, T &z) {
  read(x);
  read(y);
  read(z);
}
template <typename T>
void writeC(T x) {
  if (x < 0) x = ~x + 1, putchar('-');
  if (x > 9) writeC(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
void write(T x) {
  writeC(x);
  putchar(' ');
}
template <typename T>
void writeN(T x) {
  writeC(x);
  puts("");
}
