#include <bits/stdc++.h>
using namespace std;
vector<int> v[1005];
bool vis[1005];
vector<int> ans;
int n, check = 0;
void make() {
  for (int i = 1; i <= 1000; i++) {
    for (int j = 2; j <= 4; j++) {
      if (i + j <= 1000) {
        v[i].push_back(i + j);
        v[i + j].push_back(i);
      }
    }
  }
  return;
}
void dfs(int a) {
  vis[a] = 1;
  if (ans.size() == n) {
    check = 1;
    for (int i = 0; i < n; i++) cout << ans[i] << " ";
    cout << endl;
    ans.clear();
    return;
  }
  for (int i = 0; i < v[a].size(); i++) {
    if (!vis[v[a][i]] && v[a][i] <= n && !check) {
      ans.push_back(v[a][i]);
      dfs(v[a][i]);
      ans.pop_back();
    }
  }
  return;
}
int main() {
  int t;
  cin >> t;
  make();
  while (t--) {
    cin >> n;
    if (n < 4)
      cout << -1 << endl;
    else {
      check = 0;
      memset(vis, 0, sizeof vis);
      ans.push_back(n - 1);
      dfs(n - 1);
      ans.clear();
    }
  }
  return 0;
}
