#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    if (n == 2 || n == 3)
      cout << "-1\n";
    else {
      if (n % 4 == 0) {
        for (long long i = 1; i <= n; i += 4)
          cout << i + 1 << " " << i + 3 << " " << i << " " << i + 2 << " ";
      } else if (n % 4 == 1) {
        n -= 1;
        for (long long i = 1; i <= n; i += 4)
          cout << i + 1 << " " << i + 3 << " " << i << " " << i + 2 << " ";
        cout << n + 1;
      } else if (n % 4 == 2) {
        n -= 2;
        long long i = 1;
        for (i = 1; i <= (n - 4); i += 4)
          cout << i + 1 << " " << i + 3 << " " << i << " " << i + 2 << " ";
        cout << i + 1 << " " << i + 4 << " " << i << " " << i + 2 << " "
             << i + 5 << " " << i + 3;
      } else {
        n -= 3;
        long long i = 1;
        for (i = 1; i <= (n - 4); i += 4)
          cout << i + 1 << " " << i + 3 << " " << i << " " << i + 2 << " ";
        cout << i + 1 << " " << i + 4 << " " << i << " " << i + 2 << " "
             << i + 5 << " " << i + 3 << " " << i + 6;
      }
      cout << "\n";
    }
  }
  return 0;
}
