#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  long long int t, n, i, j, p;
  cin >> t;
  while (t--) {
    cin >> n;
    if (n < 4) {
      cout << -1 << "\n";
      continue;
    }
    vector<long long int> ans;
    for (i = 2; i <= n; i += 2) {
      ans.push_back(i);
    }
    if (n % 2)
      j = n;
    else
      j = n - 1;
    for (i = j; i >= 1; i -= 2) {
      ans.push_back(i);
    }
    for (i = 0; i < n; i++) {
      if (ans[i] == n) {
        if (n % 2 == 0) {
          p = ans[i + 1];
          ans[i + 1] = ans[i + 2];
          ans[i + 2] = p;
        } else {
          p = ans[i - 1];
          ans[i - 1] = ans[i - 2];
          ans[i - 2] = p;
        }
        break;
      }
    }
    for (i = 0; i < n; i++) {
      cout << ans[i] << " ";
    }
    cout << "\n";
  }
  return (0);
}
