#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> g;
vector<bool> v;
vector<int> ans;
int n;
void dfs(int node, int i) {
  v[node] = true;
  ans[i++] = node;
  if (i == n) return;
  for (int j = 0; j < (int)g[node].size(); j++) {
    if (!v[g[node][j]]) dfs(g[node][j], i);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    g.clear();
    g.resize(n);
    ans.clear();
    ans.resize(n);
    for (int i = 0; i < n; i++) {
      for (int j = 2; j <= 4; j++) {
        if (i + j < n) {
          g[i].push_back(i + j);
          g[i + j].push_back(i);
        }
      }
    }
    for (int i = 0; i < n; i++) {
      v.clear();
      v.resize(n);
      ans[n - 1] = -1;
      dfs(i, 0);
      if (ans[n - 1] != -1) {
        for (int j = 0; j < n; j++) cout << ans[j] + 1 << " ";
        cout << endl;
        break;
      }
    }
    if (ans[n - 1] == -1) cout << -1 << endl;
  }
  return 0;
}
