#include <bits/stdc++.h>
using namespace std;
// Macros for convenience
#define ll long long
#define ull unsigned long long
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
typedef vector<ll> vl;
typedef pair<ll, ll> pl;
// Constants
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
// Fast input/output
void fast_io()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
// Utility functions
template <typename T>
void print_vector(const vector<T> &v)
{
for (const T &x : v)
{
cout << x << " ";
}
cout << "\n";
}
ll mod_exp(ll base, ll exp, ll mod = MOD)
{
ll res = 1;
while (exp > 0)
{
if (exp % 2 == 1)
res = (res * base) % mod;
base = (base * base) % mod;
exp /= 2;
}
return res;
}
ll gcd(ll a, ll b)
{
while (b)
{
a %= b;
swap(a, b);
}
return a;
}
ll lcm(ll a, ll b)
{
return (a / gcd(a, b)) * b;
}
bool isPrime(ll n) {
// Handle edge cases
if (n <= 1) return false;
if (n <= 3) return true;
if (n % 2 == 0 || n % 3 == 0) return false;
// Check for factors from 5 to sqrt(n)
for (ll i = 5; i <= sqrtl(n); i += 6) {
if (n % i == 0 || n % (i + 2) == 0) {
return false;
}
}
return true;
}
ll modInverse(ll a, ll m) {
return mod_exp(a, m - 2, m);
}
void GcdOne(ll &p, ll &q) {
// If gcd(p, q) == 1, divide both p and q by their gcd
ll g = gcd(p, q);
p /= g;
q /= g;
}
bool isPalindrome(const string& str) {
string cleaned_str;
string reversed_str = cleaned_str;
reverse(reversed_str.begin(), reversed_str.end());
return cleaned_str == reversed_str;
}
// Solution function
void solve()
{
int n;
cin>>n;
if(n<=4)cout<<-1<<endl;
else{
for(int i=1;i<=n;i+=2){
if(i!=5){
cout<<i<<" ";
}
}
cout<<5<<" "<<4<<" ";
for(int i=2;i<=n;i+=2){
if(i!=4)cout<<i<<" ";
}
cout<<'\n';
}
}
// Main function
int main()
{
fast_io();
int t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}
I2luY2x1ZGUgPG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