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