#include <bits/stdc++.h>
using namespace std;
vector<int> merge(vector<int> odd, vector<int> even) {
  vector<int> a = odd;
  for (auto it : even) {
    a.push_back(it);
  }
  return a;
}
int main() {
  int t;
  cin >> t;
  vector<vector<int>> v(1000 + 1);
  v[0] = {-1};
  v[1] = {-1};
  v[2] = {-1};
  v[3] = {-1};
  vector<int> odd, even;
  odd = {3, 1};
  even = {4, 2};
  v[4] = merge(odd, even);
  odd = {3, 1, 5};
  even = {2, 4};
  v[5] = merge(odd, even);
  for (int i = 6; i <= 1000; i++) {
    if (i & 1) {
      odd.push_back(i);
    } else {
      even.push_back(i);
    }
    int diff = abs(odd[odd.size() - 1] - even[0]);
    if (diff < 2 || diff > 4) {
      int s = 0, e = even.size() - 2;
      while (s <= e) {
        swap(even[s++], even[e--]);
      }
    }
    v[i] = merge(odd, even);
  }
  while (t--) {
    int n;
    cin >> n;
    for (auto it : v[n]) {
      cout << it << " ";
    }
    cout << endl;
  }
}
