import java.io.*;
import java.math.*;
import java.util.*;

public class test {

	static int INF = 1000000007;

	public static void main(String[] args) {
		int test = fs.nextInt();
//		int test = 1;
		for (int cases = 0; cases < test; cases++) {
			int n = fs.nextInt();
			int ar[] = new int[n];
			int x = 1;
			int start = 0;
			if (n <= 3) {
				System.out.println(-1);
			} else {
				while (true) {
					ar[start] = x;
					x += 2;
					++start;
					if (x > n) {
						break;
					}
				}
				x = n % 2 == 0 ? n : n - 1;
				while (true) {
					ar[start] = x;
					x -= 2;
					++start;
					if (x < 2) {
						break;
					}
				}
				int z = n % 2 != 0 ? n / 2 : n / 2 - 1;
				int p = z - 1;
				int s = z + 1;
				int k = s + 1;
				boolean rs = false;
				// s1
				if (Math.abs(ar[s] - ar[z]) < 2 || Math.abs(ar[s] - ar[z]) > 4) {
					if (Math.abs(ar[z] - ar[k]) >= 2 && Math.abs(ar[z] - ar[k]) <= 4) {
						rs = true;
						int temp = ar[s];
						ar[s] = ar[k];
						ar[k] = temp;
					}
				}
				// s2
				if (Math.abs(ar[s] - ar[z]) < 2 || Math.abs(ar[s] - ar[z]) > 4) {
					if (Math.abs(ar[s] - ar[p]) >= 2 && Math.abs(ar[s] - ar[p]) <= 4) {
						rs = true;
						int temp = ar[p];
						ar[p] = ar[z];
						ar[z] = temp;
					}
				}
				for (int i : ar) {
					System.out.print(i + " ");
				}
			}
		}

	}

	static boolean isBalanced(String s) {
		Stack<Character> st = new Stack<Character>();
		for (int i = 0; i < s.length(); i++) {
			if (s.charAt(i) == '0' && st.isEmpty()) {
				return false;
			} else {
				if (s.charAt(i) == '1') {
					st.push(s.charAt(i));
				} else {
					char x = st.peek();
					if (x == '1') {
						st.pop();
					}
				}
			}
		}
		if (st.isEmpty()) {
			return true;
		} else {
			return false;
		}
	}

	static boolean isSubSequence(String str1, String str2, int m, int n) {
		if (m == 0)
			return true;
		if (n == 0)
			return false;
		if (str1.charAt(m - 1) == str2.charAt(n - 1))
			return isSubSequence(str1, str2, m - 1, n - 1);
		return isSubSequence(str1, str2, m, n - 1);
	}

	static long power(long x, long y, long p) {
		long res = 1;
		x = x % p;
		while (y > 0) {
			if (y % 2 == 1)
				res = (res * x) % p;
			y = y >> 1;
			x = (x * x) % p;
		}
		return res;
	}

	static long modInverse(long n, long p) {
		return power(n, p - 2, p);
	}

	static long nCrModPFermat(long n, long r, long p) {
		long ans1 = 1;
		long i = n;
		long k = r;
		while (k > 0) {
			ans1 = mul(ans1, i, p);
			i--;
			k--;
		}
		long ans2 = 1;
		while (r > 0) {
			ans2 = mul(ans2, r, p);
			r--;
		}
		r = modInverse(ans2, p);
		ans1 = mul(ans1, r, p);
		return ans1;
	}

	static long facCalc(long total) {
		long ans = 1;
		for (long i = 2; i <= total; i++) {
			ans = mul(ans, i, INF);
		}
		return ans;
	}

	static long mul(long a, long b, long p) {
		return ((a % p) * (b % p)) % p;
	}

	static void sieve() {
		boolean prime[] = new boolean[101];
		Arrays.fill(prime, true);
		prime[1] = false;
		for (int i = 2; i * i <= prime.length - 1; i++) {
			for (int j = i * i; j <= prime.length - 1; j += i) {
				prime[j] = false;
			}
		}
	}

	public static int[] radixSort(int[] f) {
		return radixSort(f, f.length);
	}

	public static int[] radixSort(int[] f, int n) {
		int[] to = new int[n];
		{
			int[] b = new int[65537];
			for (int i = 0; i < n; i++)
				b[1 + (f[i] & 0xffff)]++;
			for (int i = 1; i <= 65536; i++)
				b[i] += b[i - 1];
			for (int i = 0; i < n; i++)
				to[b[f[i] & 0xffff]++] = f[i];
			int[] d = f;
			f = to;
			to = d;
		}
		{
			int[] b = new int[65537];
			for (int i = 0; i < n; i++)
				b[1 + (f[i] >>> 16)]++;
			for (int i = 1; i <= 65536; i++)
				b[i] += b[i - 1];
			for (int i = 0; i < n; i++)
				to[b[f[i] >>> 16]++] = f[i];
			int[] d = f;
			f = to;
			to = d;
		}
		return f;
	}

	static void printArray(int ar[]) {
		System.out.println(Arrays.toString(ar));
	}

	static class Pair {
		int first, second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}

	}

	static class LongPair {
		long first;
		long second;

		LongPair(long a, long b) {
			this.first = a;
			this.second = b;
		}

	}

	static long expmodulo(long a, long b, long c) {
		long x = 1;
		long y = a;
		while (b > 0) {
			if (b % 2 == 1) {
				x = (x * y) % c;
			}
			y = (y * y) % c; // squaring the base
			b /= 2;
		}
		return (long) x % c;
	}

	// static int modInverse(int a, int m) {
	// int m0 = m;
	// int y = 0, x = 1;
	//
	// if (m == 1)
	// return 0;
	//
	// while (a > 1) {
	// int q = a / m;
	// int t = m;
	// m = a % m;
	// a = t;
	// t = y;
	// y = x - q * y;
	// x = t;
	// }
	// if (x < 0)
	// x += m0;
	// return x;
	// }

	static int gcd(int a, int b) {
		if (b == 0)
			return a;
		return gcd(b, a % b);
	}

	static void sortMyMapusingValues(HashMap<Integer, Integer> hm) {

		List<Map.Entry<Integer, Integer>> capitalList = new LinkedList<>(hm.entrySet());

		Collections.sort(capitalList, new Comparator<Map.Entry<Integer, Integer>>() {
			public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) {
				return (o1.getValue()).compareTo(o2.getValue());
			}
		});
		HashMap<Integer, Integer> result = new HashMap<>();
		for (Map.Entry<Integer, Integer> entry : capitalList) {
			result.put(entry.getKey(), entry.getValue());
		}
	}

	static boolean ispowerof2(long num) {
		if ((num & (num - 1)) == 0)
			return true;
		return false;
	}

	static void primeFactors(int n) {
		while (n % 2 == 0) {
			System.out.print(2 + " ");
			n /= 2;
		}
		for (int i = 3; i <= Math.sqrt(n); i += 2) {
			while (n % i == 0) {
				System.out.print(i + " ");
				n /= i;
			}
		}
		if (n > 2)
			System.out.print(n);
	}

	static boolean isPrime(long n) {
		// Corner cases
		if (n <= 1)
			return false;
		if (n <= 3)
			return true;
		if (n % 2 == 0 || n % 3 == 0)
			return false;

		long sq = (long) Math.sqrt(n);
		for (int i = 5; i <= sq; i = i + 6)
			if (n % i == 0 || n % (i + 2) == 0)
				return false;

		return true;
	}

	static class Graph {
		HashMap<Integer, LinkedList<Integer>> hm = new HashMap<Integer, LinkedList<Integer>>();

		private void addVertex(int vertex) {
			hm.put(vertex, new LinkedList<>());
		}

		private void addEdge(int source, int dest, boolean bi) {
			if (!hm.containsKey(source))
				addVertex(source);
			if (!hm.containsKey(dest))
				addVertex(dest);
			hm.get(source).add(dest);
			if (bi) {
				hm.get(dest).add(source);
			}
		}

		private boolean uniCycle(int i, HashSet<Integer> visited, int parent) {
			visited.add(i);
			LinkedList<Integer> list = hm.get(i);
			Iterator<Integer> it = list.iterator();
			while (it.hasNext()) {
				Integer integer = (Integer) it.next();
				if (!visited.contains(integer)) {
					if (uniCycle(integer, visited, i))
						return true;
				} else if (integer != parent) {
					return true;
				}
			}
			return false;
		}

		private boolean uniCyclic() {
			HashSet<Integer> visited = new HashSet<Integer>();
			Set<Integer> set = hm.keySet();
			for (Integer integer : set) {
				if (!visited.contains(integer)) {
					if (uniCycle(integer, visited, -1)) {
						return true;
					}
				}
			}
			return false;
		}

		private boolean isbiCycle(int i, HashSet<Integer> visited, HashSet<Integer> countered) {
			if (countered.contains(i))
				return true;
			if (visited.contains(i))
				return false;
			visited.add(i);
			countered.add(i);
			LinkedList<Integer> list = hm.get(i);
			Iterator<Integer> it = list.iterator();
			while (it.hasNext()) {
				Integer integer = (Integer) it.next();
				if (isbiCycle(integer, visited, countered)) {
					return true;
				}
			}
			countered.remove(i);
			return false;
		}

		Boolean isReachable(int s, int d, int k) {
			if (hm.isEmpty()) {
				return false;
			}
			LinkedList<Integer> temp;
			boolean visited[] = new boolean[k];
			LinkedList<Integer> queue = new LinkedList<Integer>();
			visited[s] = true;
			queue.add(s);
			Iterator<Integer> i;
			while (queue.size() != 0) {
				s = queue.poll();
				int n;
				i = hm.get(s).listIterator();

				// Get all adjacent vertices of the dequeued vertex s
				// If a adjacent has not been visited, then mark it
				// visited and enqueue it
				while (i.hasNext()) {
					n = i.next();

					// If this adjacent node is the destination node,
					// then return true
					if (n == d)
						return true;

					// Else, continue to do BFS
					if (!visited[n]) {
						visited[n] = true;
						queue.add(n);
					}
				}
			}

			// If BFS is complete without visited d
			return false;
		}

		private boolean isbiCyclic() {
			HashSet<Integer> visited = new HashSet<Integer>();
			HashSet<Integer> countered = new HashSet<Integer>();
			Set<Integer> set = hm.keySet();
			for (Integer integer : set) {
				if (isbiCycle(integer, visited, countered)) {
					return true;
				}
			}
			return false;
		}
	}

	static class Node {
		Node left, right;
		int data;

		public Node(int data) {
			this.data = data;
		}

		public void insert(int val) {
			if (val <= data) {
				if (left == null) {
					left = new Node(val);
				} else {
					left.insert(val);
				}
			} else {
				if (right == null) {
					right = new Node(val);
				} else {
					right.insert(val);
				}
			}
		}

		public boolean contains(int val) {
			if (data == val) {
				return true;
			} else if (val < data) {
				if (left == null) {
					return false;
				} else {
					return left.contains(val);
				}
			} else {
				if (right == null) {
					return false;
				} else {
					return right.contains(val);
				}
			}
		}

		public void inorder() {
			if (left != null) {
				left.inorder();
			}
			System.out.print(data + " ");
			if (right != null) {
				right.inorder();
			}
		}

		public int maxDepth() {
			if (left == null)
				return 0;
			if (right == null)
				return 0;
			else {
				int ll = left.maxDepth();
				int rr = right.maxDepth();
				if (ll > rr)
					return (ll + 1);
				else
					return (rr + 1);
			}
		}

		public int countNodes() {
			if (left == null)
				return 1;
			if (right == null)
				return 1;
			else {
				return left.countNodes() + right.countNodes() + 1;
			}
		}

		public void preorder() {
			System.out.print(data + " ");
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}

		}

		public void postorder() {
			if (left != null) {
				left.inorder();
			}

			if (right != null) {
				right.inorder();
			}
			System.out.print(data + " ");

		}

		public void levelorder(Node node) {
			LinkedList<Node> ll = new LinkedList<Node>();
			ll.add(node);
			getorder(ll);

		}

		public void getorder(LinkedList<Node> ll) {
			while (!ll.isEmpty()) {
				Node node = ll.poll();
				System.out.print(node.data + " ");
				if (node.left != null)
					ll.add(node.left);
				if (node.right != null)
					ll.add(node.right);
			}
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}

	static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object... objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object... objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

	}

	private static final FastReader fs = new FastReader();
	private static final OutputWriter op = new OutputWriter(System.out);
}


import java.util.*;
import javafx.util.Pair;
import java.util.Comparator;

public class Main
{
    public static void Even(int n)
    {
        int N=n-1;
        n+=2;
        while (n!=2)
        {
            n-=2;
            System.out.print(n+" ");
        }
        n+=3;
        System.out.print(n+" ");
        n-=4;
        System.out.print(n+" ");
        n+=2;
        System.out.print(n+" ");
        n+=4;
        System.out.print(n+" ");
        while (n!=N)
        {
            n+=2;
            System.out.print(n+" ");
        }
    }

    public static void Odd(int n)
    {
        int N=n-1;
        n+=2;
        while (n!=1)
        {
            n-=2;
            System.out.print(n+" ");
        }
        n+=3;
        System.out.print(n+" ");
        n-=2;
        System.out.print(n+" ");
        n+=4;
        System.out.print(n+" ");
        while (n!=N)
        {
            n+=2;
            System.out.print(n+" ");
        }
    }

    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        int t;
        t=in.nextInt();
        while (t-- > 0)
        {
            int n=in.nextInt();
            if (n<4)
            {
                System.out.println(-1);
            }
            else if (n==4)
            {
                System.out.println("3 1 4 2");
            }
            else if (n==5)
            {
                System.out.println("1 4 2 5 3");
            }
            else if (n==6)
            {
                System.out.println("1 3 5 2 4 6");
            }
            else
            {
                if (n%2==0) Even(n);
                else Odd(n);
            }

        }
    }
}


import java.util.*;
import javafx.util.Pair;
import java.util.Comparator;

public class Main
{
    public static void Even(int n)
    {
        int N=n-1;
        while (n!=2)
        {
            System.out.print(n+" ");
            n-=2;
        }
        n+=3;
        System.out.print(n+" ");
        n-=4;
        System.out.print(n+" ");
        n+=2;
        System.out.print(n+" ");
        n+=4;
        System.out.print(n+" ");
        while (n!=N)
        {
            n+=2;
            System.out.print(n+" ");
        }
    }

    public static void Odd(int n)
    {
        int N=n-1;
        while (n!=1)
        {
            System.out.print(n+" ");
            n-=2;
        }
        n+=3;
        System.out.print(n+" ");
        n-=2;
        System.out.print(n+" ");
        n+=4;
        System.out.print(n+" ");
        while (n!=N)
        {
            n+=2;
            System.out.print(n+" ");
        }
    }

    public static void main(String[] args)
    {
        Scanner in=new Scanner(System.in);
        int t;
        t=in.nextInt();
        while (t-- > 0)
        {
            int n=in.nextInt();
            if (n<4)
            {
                System.out.println(-1);
            }
            else if (n==5)
            {
                System.out.println("1 4 2 5 3");
            }
            else if (n==6)
            {
                System.out.println("1 3 5 2 4 6");
            }
            else
            {
                if (n%2==0) Even(n);
                else Odd(n);
            }

        }
    }
}


/**
 * @author egaeus
 * @mail sebegaeusprogram@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.TreeSet;
import java.util.stream.Collectors;

import static java.lang.Integer.parseInt;

public class CFG {
    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int T = parseInt(in.readLine());
        for (int t = 0; t < T; t++) {
            int N = parseInt(in.readLine());
            if (N > 4) {
                ArrayList<Integer> result = new ArrayList<>();
                for (int i = N - N % 2; i > 0; i -= 2)
                    result.add(i);
                result.add(5);
                result.add(1);
                result.add(3);
                for (int i = 7; i <= N; i += 2)
                    result.add(i);
                System.out.println(result.stream().map(a -> a + "").collect(Collectors.joining(" ")));
            } else if (N == 4)
                System.out.println("3 1 4 2");
            else
                System.out.println(-1);
        }
    }
}


/**
 * @author egaeus
 * @mail sebegaeusprogram@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.TreeSet;
import java.util.stream.Collectors;

import static java.lang.Integer.parseInt;

public class CFG {
    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int T = parseInt(in.readLine());
        for (int t = 0; t < T; t++) {
            int N = parseInt(in.readLine());
            if (N > 4) {
                ArrayList<Integer> result = new ArrayList<>();
                for (int i = N - N % 2; i > 0; i -= 2)
                    result.add(i);
                result.add(3);
                result.add(1);
                for (int i = 5; i <= N; i += 2)
                    result.add(i);
                System.out.println(result.stream().map(a -> a + "").collect(Collectors.joining(" ")));
            } else if (N == 4)
                System.out.println("3 1 4 2");
            else
                System.out.println(-1);
        }
    }
}


/**
 * @author egaeus
 * @mail sebegaeusprogram@gmail.com
 * @veredict
 * @url
 * @category
 * @date
 **/

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.TreeSet;
import java.util.stream.Collectors;

import static java.lang.Integer.parseInt;

public class CFG {
    public static void main(String args[]) throws Throwable {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int T = parseInt(in.readLine());
        for (int t = 0; t < T; t++) {
            int N = parseInt(in.readLine());
            if (N > 3) {
                ArrayList<Integer> result = new ArrayList<>();
                for (int i = N - N % 2; i > 0; i -= 2)
                    result.add(i);
                result.add(3);
                result.add(1);
                for (int i = 5; i <= N; i += 2)
                    result.add(i);
                System.out.println(result.stream().map(a -> a + "").collect(Collectors.joining(" ")));
            } else System.out.println(-1);
        }
    }
}


import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class G_Special_Permutation {
	public static void main(String[] args) {
		MyScanner sc = new MyScanner();
	    PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	    int T = sc.nextInt();

	    while(T-- > 0) {
	    	int n = sc.nextInt();

	    	if(n <= 3) {
	    		out.println(-1);
	    		continue;
	    	}

	    	ArrayList<Integer> sol = new ArrayList<>();
	    	if(n%2 == 0) {
	    		for(int i = 2; i <= n; i+=2) {
	    			sol.add(i);
	    		}
	    		sol.add(n - 3);
	    		sol.add(n - 1);
	    		for(int i = n - 5; i >= 1; i -= 2) {
	    			sol.add(i);
	    		}
	    	}else {
	    		for(int i = 1; i <= n; i+=2) {
	    			sol.add(i);
	    		}
	    		sol.add(n - 3);
	    		sol.add(n - 1);
	    		for(int i = n - 5; i >= 1; i -= 2) {
	    			sol.add(i);
	    		}
	    	}

	    	sol.stream().forEach(a -> out.print(a + " "));
	    	out.println();
	    }

	    out.close();
	}

	private static class MyScanner {
		BufferedReader br;
	    StringTokenizer st;

	    public MyScanner() {
	       br = new BufferedReader(new InputStreamReader(System.in));
	    }

	    String next() {
	    	while (st == null || !st.hasMoreElements()) {
	    		try {
	    			st = new StringTokenizer(br.readLine());

	    		} catch (IOException e) {
	    			e.printStackTrace();
	            }
	          }
	    	return st.nextToken();
	   }

	   int nextInt() {
		   return Integer.parseInt(next());
	   }

	   long nextLong() {
		   return Long.parseLong(next());
	   }

	   double nextDouble() {
		   return Double.parseDouble(next());
	   }

	   String nextLine(){
		   String str = "";
		   try {
			   str = br.readLine();
		   } catch (IOException e) {
			   e.printStackTrace();
		   }
		   return str;
	   }
	}
}


import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * @author shubhamsaxena
 * Solution is at the Top
 */
public class Header {

    private final long MOD = 998244353L;

    private void solve() {
        int t = inpi();
        while (t-- > 0) {
            int n = inpi();
            if (n < 4) out.println(-1);
            else {
                switch (n % 4) {
                    case 0:
                        printOrder(n);
                        break;
                    case 1:
                        printOrder(n - 1);
                        out.print(n);
                        break;
                    case 2:
                        printOrder(n - 6);
                        out.print((n - 4) + " " + (n - 1) + " " + (n - 5) + " " + (n - 3) + " " + (n) + " " + (n - 2));
                        break;
                    case 3:
                        printOrder(n - 7);
                        out.print((n - 5) + " " + (n - 2) + " " + (n - 6) + " " + (n - 4) + " " + (n - 1) + " " + (n - 3) + " " + (n));
                        break;
                }
                out.println();
            }
        }
    }

    private void printOrder(int n) {
        //n%4 == 0 always
        for (int i = 1; i <= n; i += 4) {
            out.print((i + 1) + " " + (i + 3) + " " + (i) + " " + (i + 2) + " ");
        }
    }

    public boolean isPrime(long n) {
        return BigInteger.valueOf(n).isProbablePrime(5);
    }

    public boolean[] sieveOfEratosthenes(int n) {
        boolean prime[] = new boolean[n + 1];
        Arrays.fill(prime, true);
        for (int p = 2; p * p <= n; p++) {
            if (prime[p]) {
                for (int i = p * 2; i <= n; i += p) {
                    prime[i] = false;
                }
            }
        }
        for (int p = 2; p <= n; p++) {
            if (prime[p]) {

            }
        }
        return prime;
    }

    InputStream obj;
    PrintWriter out;
    String check = "";

    public static void main(String[] args) {
        new Thread(null, () -> {
            try {
                new Header().main1();
            } catch (IOException ex) {
                Logger.getLogger(Header.class.getName()).log(Level.SEVERE, null, ex);
                throw new RuntimeException();
            }
        }, "1", 1 << 26).start();

    }

    void main1() throws IOException {
        out = new PrintWriter(System.out);
        obj = check.isEmpty() ? System.in : new ByteArrayInputStream(check.getBytes());
        solve();
        out.flush();
        out.close();
    }

    private byte[] inbuffer = new byte[1024];
    private int lenbuffer = 0, ptrbuffer = 0;

    int readByte() {
        if (lenbuffer == -1) {
            throw new InputMismatchException();
        }
        if (ptrbuffer >= lenbuffer) {
            ptrbuffer = 0;
            try {
                lenbuffer = obj.read(inbuffer);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
        }
        if (lenbuffer <= 0) {
            return -1;
        }
        return inbuffer[ptrbuffer++];
    }

    boolean isSpaceChar(int c) {
        return (!(c >= 33 && c <= 126));
    }

    int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    String inps() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    int inpi() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    long inpl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    float inpf() {
        return Float.parseFloat(inps());
    }

    double inpd() {
        return Double.parseDouble(inps());
    }

    char inpc() {
        return (char) skip();
    }

    int[] inpia(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = inpi();
        }
        return a;
    }

    long[] inpla(int n) {
        long a[] = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = inpl();
        }
        return a;
    }

    String[] inpsa(int n) {
        String a[] = new String[n];
        for (int i = 0; i < n; i++) {
            a[i] = inps();
        }
        return a;
    }

    double[][] inpdm(int n, int m) {
        double a[][] = new double[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = inpd();
            }
        }
        return a;
    }

    int[][] inpim(int n, int m) {
        int a[][] = new int[n][m];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < m; j++) {
                a[i][j] = inpi();
            }
        }
        return a;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.StringTokenizer;

public class Solution {
	public static void main ( String args [] ) throws IOException, InterruptedException {

			solve();}

public static void solve() throws IOException, InterruptedException {
Scanner sc = new Scanner(System.in);
int x= sc.nextInt();
all:for(int c=0;c<x;c++) {
int n=sc.nextInt();
int keep=n;
int arr[] = new int[n];
if(n<=3) {
	System.out.println(-1);
	continue all;
}
int j=0;
for(int i=2;i<=n;i+=2) {
	arr[j]=i;
	j++;
}
if(n%2==0) {
	n--;
}
for(int i=n;i>0;i-=2) {
	arr[j]=i;
	j++;
}
if(keep%2==0) {

for(int i=0;i<arr.length-1;i++) {
	if(arr[i]%2!=0) {
		int temp = arr[i+1];
		arr[i+1]=arr[i];
		arr[i]=temp;
		break;
	}
}
for(int i=0;i<arr.length;i++) {
	System.out.print(arr[i]+" ");
}
System.out.println();
}else {
	for(int i=0;i<arr.length-1;i++) {
		if(arr[i]%2!=0) {
			int temp = arr[i+2];
			arr[i+2]=arr[i];
			arr[i]=temp;
			temp = arr[i+2];
			arr[i+2]=arr[i+1];
			arr[i+1]=temp;
			break;
		}
	}
	for(int i=0;i<arr.length;i++) {
		System.out.print(arr[i]+" ");
	}
	System.out.println();
}

}
}

static void shuffle(int[] a)
{
	int n = a.length;
	for(int i = 0; i < n; i++)
	{
		int r = i + (int)(Math.random() * (n - i));
		int tmp = a[i];
		a[i] = a[r];
		a[r] = tmp;
	}
}

}

@SuppressWarnings("rawtypes")
class Pair implements Comparable{
	int x;
	int y;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + x;
		result = prime * result + y;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Pair other = (Pair) obj;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}

	public Pair(int x , int y) {
		this.x=x;
		this.y=y;
	}

	@Override
	public int compareTo(Object o) {
		Pair p = (Pair)o;
		if(this.x<p.x) return -1;
		if(this.y>p.y) return 1;
		return 0;
	}

}

class Scanner
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException
	{
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}

	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}

	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}

	public boolean ready() throws IOException {return br.ready();}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.StringTokenizer;

public class Solution {
	public static void main ( String args [] ) throws IOException, InterruptedException {

			solve();}

public static void solve() throws IOException, InterruptedException {
Scanner sc = new Scanner(System.in);
int x= sc.nextInt();
all:for(int c=0;c<x;c++) {
int n=sc.nextInt();
int arr[] = new int[n];
if(n<=3) {
	System.out.println(-1);
	continue all;
}
int j=0;
for(int i=2;i<=n;i+=2) {
	arr[j]=i;
	j++;
}
if(n%2==0) {
	n--;
}
for(int i=n;i>0;i-=2) {
	arr[j]=i;
	j++;
}
for(int i=0;i<arr.length-1;i++) {
	if(arr[i]%2!=0) {
		int temp = arr[i+1];
		arr[i+1]=arr[i];
		arr[i]=temp;
		break;
	}
}
for(int i=0;i<arr.length;i++) {
	System.out.print(arr[i]+" ");
}
System.out.println();

}
}

static void shuffle(int[] a)
{
	int n = a.length;
	for(int i = 0; i < n; i++)
	{
		int r = i + (int)(Math.random() * (n - i));
		int tmp = a[i];
		a[i] = a[r];
		a[r] = tmp;
	}
}

}

@SuppressWarnings("rawtypes")
class Pair implements Comparable{
	int x;
	int y;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + x;
		result = prime * result + y;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Pair other = (Pair) obj;
		if (x != other.x)
			return false;
		if (y != other.y)
			return false;
		return true;
	}

	public Pair(int x , int y) {
		this.x=x;
		this.y=y;
	}

	@Override
	public int compareTo(Object o) {
		Pair p = (Pair)o;
		if(this.x<p.x) return -1;
		if(this.y>p.y) return 1;
		return 0;
	}

}

class Scanner
{
	StringTokenizer st;
	BufferedReader br;

	public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

	public String next() throws IOException
	{
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException {return Integer.parseInt(next());}

	public long nextLong() throws IOException {return Long.parseLong(next());}

	public String nextLine() throws IOException {return br.readLine();}

	public double nextDouble() throws IOException
	{
		String x = next();
		StringBuilder sb = new StringBuilder("0");
		double res = 0, f = 1;
		boolean dec = false, neg = false;
		int start = 0;
		if(x.charAt(0) == '-')
		{
			neg = true;
			start++;
		}
		for(int i = start; i < x.length(); i++)
			if(x.charAt(i) == '.')
			{
				res = Long.parseLong(sb.toString());
				sb = new StringBuilder("0");
				dec = true;
			}
			else
			{
				sb.append(x.charAt(i));
				if(dec)
					f *= 10;
			}
		res += Long.parseLong(sb.toString()) / f;
		return res * (neg?-1:1);
	}

	public boolean ready() throws IOException {return br.ready();}

}


import java.util.Scanner;

public class Solution {

	public static void solver(int n) {
		if (n < 4) {
			System.out.println(-1);
			return;
		}
		int[] arr = new int[n];
		int start = n - (n + 1) % 2;
		int i = 0;
		while (start >= 1) {
			arr[i] = start;
			i++;
			start -= 2;
		}
		arr[i] = 4;
		i++;
		start = 2;
		for (; i < n; i++) {

			arr[i] = start;
			if (start == 2) {
				start = start + 4;
			} else {
				start = start + 2;
			}
		}
		for (int j = 0; j < n; j++) {
			System.out.print(arr[j] + " ");
		}
		System.out.println();
	}

	public static void main(String[] args) {

		Scanner s = new Scanner(System.in);
		int t = s.nextInt();
		s.nextLine();
		for (int i = 0; i < t; i++) {
			int n = s.nextInt();
			solver(n);
		}
	}
}


import java.util.*;
import java.io.*;
public class Main{
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

    }
    static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object...objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

		}

    static class IOUtils {

		public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.nextInt();
            return array;
        }

    }
    static int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    static int mod = (int)(1e9+7);
    public static long pow(long a,long b)
    {
        long ans = 1;
        while(b> 0)
        {
            if((b & 1)==1){
                ans = (ans*a) % mod;
            }
            a = (a*a) % mod;
            b = b>>1;
        }
        return ans;
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        //IOUtils io = new IOUtils();
        int t = in.nextInt();
        while(t-- >0)
        {
            int n = in.nextInt();
            if(n<4)
            {
                out.printLine("-1");
                continue;
            }
            for(int i=n;i>=1;i--)
            {
                if(i%2==1)
                    out.print(i + " ");
            }
            out.print("4 2 ");
            for(int i=6;i<=n;i++)
            {
                if(i%2==0)
                    out.print(i + " ");
            }
            out.printLine();
        }
        out.flush();
        out.close();
    }
}


import java.util.*;
import java.io.*;
public class Main{
    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = nextInt();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }

    }
    static class OutputWriter {
		private final PrintWriter writer;

		public OutputWriter(OutputStream outputStream) {
			writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
		}

		public OutputWriter(Writer writer) {
			this.writer = new PrintWriter(writer);
		}

		public void print(Object...objects) {
			for (int i = 0; i < objects.length; i++) {
				if (i != 0)
					writer.print(' ');
				writer.print(objects[i]);
			}
		}

		public void printLine(Object...objects) {
			print(objects);
			writer.println();
		}

		public void close() {
			writer.close();
		}

		public void flush() {
			writer.flush();
		}

		}

    static class IOUtils {

		public static int[] readIntArray(InputReader in, int size) {
            int[] array = new int[size];
            for (int i = 0; i < size; i++)
                array[i] = in.nextInt();
            return array;
        }

    }
    static int gcd(int a, int b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }
    static int mod = (int)(1e9+7);
    public static long pow(long a,long b)
    {
        long ans = 1;
        while(b> 0)
        {
            if((b & 1)==1){
                ans = (ans*a) % mod;
            }
            a = (a*a) % mod;
            b = b>>1;
        }
        return ans;
    }

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        //IOUtils io = new IOUtils();
        int t = in.nextInt();
        while(t-- >0)
        {
            int n = in.nextInt();
            if(n<4)
            {
                out.printLine("-1");
                continue;
            }
            for(int i=n;i>=1;i--)
            {
                if(i%2==1)
                    out.print(i + " ");
            }
            out.print("4 2");
            for(int i=6;i<=n;i++)
            {
                if(i%2==0)
                    out.print(i + " ");
            }
            out.printLine();
        }
        out.flush();
        out.close();
    }
}


import java.util.*;
public class Main{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int t=sc.nextInt();
        while(t-->0){
            int n=sc.nextInt();
            int a[]=new int [n];
            if(n==2 || n==3){
                System.out.println(-1);
                continue;
            }
            int k=n;
            if(n%2==1){
            for(int i=n;i>0;i=i-2){
                System.out.print(i+" ");
            }
            System.out.print("4 2 ");
            for(int i=6;i<n;i=i+2){
                System.out.print(i+" ");
            }
            }
            else{
                for(int i=n-1;i>0;i=i-2){
                    System.out.print(i+" ");
                }
                System.out.println("4 2 ");
                for(int i=6;i<=n;i=i+2){
                    System.out.print(i+" ");
                }
            }
            System.out.println();
        }
    }
}


import java.io.PrintWriter;
import java.util.Scanner;

public class SpecialPermutation {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int t = Integer.parseInt(in.nextLine());

        while (t-- > 0) {
            solve(in, out);
        }

        in.close();
        out.close();
    }

    public static void solve(Scanner in, PrintWriter out) {
        int n = in.nextInt();
        if( n < 4 ){
            out.println(-1);
        }else {
            for (int i = n; i >= 1 ; i--) if(i % 2 != 0) out.print(i + " ");

            out.print(4 + " " + 2 + " ");

            for (int i = 6; i <= n; i++) {
                if(i % 2 == 0) out.print(i + " ");
            }
            out.println();
        }
    }
}


import java.util.*;
import java.io.*;

public class spcl{

      public static void main(String args[])throws Exception{

              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

              int t = Integer.parseInt(br.readLine());

              for(int k =0;k<t;k++){

              	 int n = Integer.parseInt(br.readLine());

              	 if(n==2||n==3){
              	 	System.out.println(-1);
              	 	continue;
              	 }
              	 if(n==4){
              	 	System.out.println(2+" "+4+" "+1+" "+3);
              	 	continue;
              	 }
              	 if(n==5){
              	 	       	 	System.out.println(2+" "+4+" "+1+" "+3+" "+5);
              	 	       	 	continue;

              	 }

              	 for(int i =2;i<=n;i+=2){
              	 	System.out.print(i+" ");
              	 }
              	 int last =0;
              	 int secondOdd =0;
              	 if(n%2==0){
              	 	last=n-3;
              	 	secondOdd=last+2;
              	 } else{
              	 	last= n-4;
              	 	secondOdd=n;
              	 }

              	 System.out.print(last+" ");

              	 for(int i = secondOdd;i>=1;i-=2){
              	 	if(i==last){
              	 		continue;
              	 	}
              	 	if(i==1){
              	 		System.out.print(1);
              	 		continue;
              	 	}

              	 	 	 System.out.print(i+" ");

              	 }
              	 System.out.println();

              }

      }

}


import java.util.*;
import java.io.*;

public class spcl{

      public static void main(String args[])throws Exception{

              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

              int t = Integer.parseInt(br.readLine());

              for(int k =0;k<t;k++){

              	 int n = Integer.parseInt(br.readLine());

              	 if(Math.abs(n-2)<2){

                        System.out.println(-1);
                        continue;

              	 }

              	 for(int i=1;i<=n;i+=2){

                 System.out.print(i+" ");

              	 }

              	  for(int i=2;i<=n;i+=2){
              	  	if(i==n){
              	  		System.out.print(i);
              	  		continue;
              	  	}

                 System.out.print(i+" ");

              	 }
              	 System.out.println();

              }

      }

}


import java.util.*;
import java.io.*;

public class spcl{

      public static void main(String args[])throws Exception{

              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

              int t = Integer.parseInt(br.readLine());

              for(int k =0;k<t;k++){

              	 int n = Integer.parseInt(br.readLine());

              	 if(n==2||n==3){
              	 	System.out.println(-1);
              	 	continue;
              	 }
              	 if(n==4){
              	 	System.out.println(2+" "+4+" "+1+" "+3);
              	 	continue;
              	 }
              	 if(n==5){
              	 	       	 	System.out.println(2+" "+4+" "+1+" "+3+" "+5);

              	 }

              	 for(int i =2;i<=n;i+=2){
              	 	System.out.print(i+" ");
              	 }
              	 int last =0;
              	 int secondOdd =0;
              	 if(n%2==0){
              	 	last=n-3;
              	 	secondOdd=last+2;
              	 } else{
              	 	last= n-4;
              	 	secondOdd=n;
              	 }

              	 System.out.print(last+" ");

              	 for(int i = secondOdd;i>=1;i-=2){
              	 	if(i==last){
              	 		continue;
              	 	}
              	 	if(i==1){
              	 		System.out.print(1);
              	 		continue;
              	 	}

              	 	 	 System.out.print(i+" ");

              	 }
              	 System.out.println();

              }

      }

}


import java.io.*;
import java.util.StringTokenizer;

public class G_SpecialPermutation {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return Integer.parseInt(st.nextToken());
    }

    public static void main(String[] args) throws IOException {
        int T = readInt();

        for (int __ = 0; __ < T; __++) {
            int n = readInt();
            if (n <= 3) {  // It is specified that n >= 2
                pw.println(-1);
                continue;
            }
            if (n == 4) {
                pw.println("2 4 1 3");
                continue;
            }

            int m = ((n - 1) / 4 - 1) * 4;
            for (int i = 1; i <= m; i += 4) {
                pw.print((i + 1) + " " + (i + 3) + " " + i + " " + (i + 2) + " ");
            }
            pw.print((m + 2) + " " + (m + 4) + " " + (m + 1) + " ");
            if (n % 4 == 1) {
                pw.println((m + 3) + " " + (m + 5));
            } else if (n % 4 == 2) {
                pw.println((m + 5) + " " + (m + 3) + " " + (m + 6));
            } else if (n % 4 == 3) {
                pw.println((m + 5) + " " + (m + 7) + " " + (m + 3) + " " + (m + 6));
            } else { //n % 4 == 0
                pw.println((m + 3) + " " + (m + 6) + " " + (m + 8)
                        + " " + (m + 5) + " " + (m + 7));
            }
        }

        pw.close();
    }
}


import java.io.*;
import java.util.StringTokenizer;

public class G_SpecialPermutation {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static final PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    private static StringTokenizer st;

    private static int readInt() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return Integer.parseInt(st.nextToken());
    }

    public static void main(String[] args) throws IOException {
        int T = readInt();

        for (int __ = 0; __ < T; __++) {
            int n = readInt();
            if (n <= 3) {  // It is specified that n >= 2
                pw.println(-1);
                continue;
            }
            for (int i = n / 2 * 2; i >= 6; i -= 2) { // All even numbers except 4 and 2.
                pw.write(i + " ");
            }
            pw.write("2 4 ");
            for (int i = 1; i <= n; i += 2) { // All odd numbers
                pw.write(i + " ");
            }
            pw.println();
        }

        pw.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.StringTokenizer;
import java.util.stream.Collectors;

public class SpecialPermutation {
    static void solve(int n) {
        if(n == 1) {
            System.out.println(1);return;
        }
        if(n < 4) {
            System.out.println(-1);return;
        }

        LinkedList<Integer> res = new LinkedList<>();
        res.add(3);
        res.add(1);
        res.add(4);
        res.add(2);

        int i = 5;
        boolean front = false;
        while(i <= n) {
            if(front) {
                res.addFirst(i);
            } else {
                res.addLast(i);
            }
            i++;
            front = !front;
        }
        String collect = res.stream().map(Object::toString).collect(Collectors.joining(" "));
        System.out.println(collect);
    }
    public static void main(String[] args) {
        FastReader reader = new FastReader();
        int tests = reader.nextInt();
        for(int test = 1; test <= tests; test++) {
            int n = reader.nextInt();
            solve(n);
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeSet;

public class code6 {

	public static void main(String[] args) throws CloneNotSupportedException {
		// TODO Auto-generated method stub
		FastReader scn = new FastReader();
		int t = scn.nextInt();
		int p = t;
		while(t-->0) {
			int n = scn.nextInt();
			if(n<4) {
				System.out.println("-1");
				continue;
			}
			if(n==4) {
				System.out.println("3 1 4 2");
				continue;
			}

			int a = n;
			if(n%2 == 1)
				a = n-1;
			for(int i=a; i>0; i-=2)
				System.out.print(i + " ");
			System.out.print("5 1 3 ");
			for(int i=7; i<=n; i+=2)
				System.out.print(i + " ");
			System.out.println();
		}

	}

	static int gcd(int a, int b)
    {
    if (a == 0)
        return b;
    return gcd(b % a, a);
    }

	//public static int
    static int lcm(int a, int b)
    {
        return (a*b)/gcd(a, b);
    }

    static class FastReader {
		BufferedReader br;
		StringTokenizer st;

		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.io.*;
import java.util.*;
public class Main {

    private static void solver(InputReader sc, PrintWriter out) {
        int test = sc.nextInt();
        for(int ii=0; ii<test; ii++){
            int n = sc.nextInt();
            List<Integer> al = new ArrayList<>();
            for(int i=1; i<=n;i++){
                if(i%2!=0) al.add(i);
            }
            if(n < 4){
                out.println(-1);
                continue;
            }
            if(n==4){
                out.println(2+" "+4+" "+1+" "+3);
                continue;
            }
            if(n==5){
                out.println(1+" "+3+" "+5+" "+2+" "+4);
                continue;
            }
            if(n%2==0) {
                al.add(n-4);
                al.add(n-2);
                al.add(n);
            }else{
                al.add(n-4+1);
                al.add(n-2+1);
            }
            for(int i=n-4;i>=2;i--){
                if(i%2==0)
                    al.add(i);
            }
            for(int xx: al) out.print(xx+" " );
            out.println();
        }
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair{
    int x,y;
    Pair(int x, int y){
        this.x = x;
        this.y = y;
    }
}


import java.io.*;
import java.util.*;
public class Main {

    private static void solver(InputReader sc, PrintWriter out) {
        int test = sc.nextInt();
        for(int ii=0; ii<test; ii++){
            int n = sc.nextInt();
            List<Integer> al = new ArrayList<>();
            for(int i=1; i<=n;i++){
                if(i%2!=0) al.add(i);
            }
            if(n < 4){
                out.println(-1);
                continue;
            }
            if(n==4){
                out.println(2+" "+4+" "+1+" "+3);
                continue;
            }
            if(n==5){
                out.println(1+" "+3+" "+5+" "+2+" "+4);
                continue;
            }
            if(n%2==0) {
                al.add(n-4);
                al.add(n-2);
                al.add(n);
            }else{
                al.add(n-4+1);
                al.add(n-2+1);
            }
            for(int i=n-4-1;i>=2;i--){
                if(i%2==0)
                    al.add(i);
            }
            for(int xx: al) out.print(xx+" " );
            out.println();
        }
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair{
    int x,y;
    Pair(int x, int y){
        this.x = x;
        this.y = y;
    }
}


import java.io.*;
import java.util.*;
public class Main {

    private static void solver(InputReader sc, PrintWriter out) {
        int test = sc.nextInt();
        for(int ii=0; ii<test; ii++){
            int n = sc.nextInt();
            List<Integer> al = new ArrayList<>();
            for(int i=1; i<=n;i++){
                if(i%2!=0) al.add(i);
            }
            if(n < 4){
                out.println(-1);
                continue;
            }
            if(n==4){
                out.println(2+" "+4+" "+1+" "+3);
                continue;
            }
            if(n==5){
                out.println(1+" "+3+" "+5+" "+2+" "+4);
                continue;
            }
            if(n%2==0) {
                al.add(n-4);
                al.add(n);
                al.add(n-2);
            }else{
                al.add(n-4+1);
                al.add(n-2+1);
                al.add(n-4);
            }
            for(int i=n-4-1;i>=2;i--){
                if(i%2==0)
                    al.add(i);
            }
            for(int xx: al) out.print(xx+" " );
            out.println();
        }
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair{
    int x,y;
    Pair(int x, int y){
        this.x = x;
        this.y = y;
    }
}


import java.io.*;
import java.util.*;
public class Main {

    private static void solver(InputReader sc, PrintWriter out) {
        int test = sc.nextInt();
        for(int ii=0; ii<test; ii++){
            int n = sc.nextInt();
            List<Integer> al = new ArrayList<>();
            for(int i=1; i<=n;i++){
                if(i%2!=0) al.add(i);
            }
            if(n < 4){
                out.println(-1);
                continue;
            }
            if(n==4){
                out.println(2+" "+4+" "+1+" "+3);
                continue;
            }
            if(n==5){
                out.println(1+" "+3+" "+5+" "+2+" "+4);
                continue;
            }
            if(n%2==0) {
                al.add(n-4);
                al.add(n);
                al.add(n-2);
            }else{
                al.add(n-4+1);
                al.add(n-2+1);
              //  al.add(n-4);
            }
            for(int i=n-4-1;i>=2;i--){
                if(i%2==0)
                    al.add(i);
            }
            for(int xx: al) out.print(xx+" " );
            out.println();
        }
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair{
    int x,y;
    Pair(int x, int y){
        this.x = x;
        this.y = y;
    }
}


import java.io.*;
public class Special
{
    public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    public static void main(String args[])throws IOException
    {
        int t=Integer.parseInt(br.readLine());
        String res[]=new String[t];
        String base;
        for(int i=0;i<t;i++)
        {
            int n=Integer.parseInt(br.readLine());
            if(n<=3)
            res[i]="-1";
            else if(n==4)
            res[i]="3 1 4 2";
            else
            {
                base="3 1 4 2";
                for(int j=5;j<=n;j++)
                {
                    if(j%2==0)
                    base=j+" "+base;
                    else
                    base=base+" "+j;
                }
                res[i]=base;
            }
        }
        for(int i=0;i<t;i++)
        System.out.println(res[i]);
    }
}


import java.io.*;
public class Special
{
    public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    public static void main(String args[])throws IOException
    {
        int t=Integer.parseInt(br.readLine());
        String res[]=new String[t];
        String base;
        for(int i=0;i<t;i++)
        {
            int n=Integer.parseInt(br.readLine());
            if(n<=3)
            res[i]=-1;
            else if(n==4)
            res[i]="3 1 4 2";
            else
            {
                base="3 1 4 2";
                for(int j=5;j<=n;j++)
                {
                    if(j%2==0)
                    base=j+" "+base;
                    else
                    base=base+" "+j;
                }
                res[i]=base;
            }
        }
        for(int i=0;i<t;i++)
        System.out.println(res[i]);
    }
}


import java.io.*;
public class Special
{
    public static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    public static void main(String args[])throws IOException
    {
        int t=Integer.parseInt(br.readLine());
        String res[]=new String[t];
        String base;
        for(int i=0;i<t;i++)
        {
            int n=Integer.parseInt(br.readLine());
            base="3 1 4 2 5";
            for(int j=6;j<=n;j++)
            {
                if(j%2==0)
                base=j+" "+base;
                else
                base=base+" "+j;
            }
            res[i]=base;
        }
        for(int i=0;i<t;i++)
        System.out.println(res[i]);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {
    private static int[] repSeq = {1, 4, 2, 6, 3, 5};
    private static int[] longerSeq = {1, 3, 6, 2, 4, 7, 9, 5, 8, 10};
    private static int[] shorterSeq = {6, 3, 1, 4, 2, 5};

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        for (int i = 0; i < t; i++) {
            int n = Integer.parseInt(br.readLine());
            StringBuilder stringBuilder = new StringBuilder();
            while (n > 12) {
                for (int j = 0; j < 6; j++) {
                    stringBuilder.append(n - repSeq[j] + 1);
                    stringBuilder.append(" ");
                }
                n -= 6;
            }

            if (n > 10) {
                for (int j = 0; j < 6; j++) {
                    stringBuilder.append(n - repSeq[j] + 1);
                    stringBuilder.append(" ");
                }
                if (n == 12)
                    stringBuilder.append("6 3 5 1 4 2");
                else
                    stringBuilder.append("5 2 4 1 3");
            } else if (n > 6) {
                for (int j = 0; j < 10; j++) {
                    int num = n + 1 - longerSeq[j];
                    if (num > 0) {
                        stringBuilder.append(num);
                        stringBuilder.append(" ");
                    }
                }
            } else if (n == 2 || n == 3) {
                stringBuilder.append("-1");
            } else {
                for (int j = 0; j < 6; j++) {
                    if (shorterSeq[j] <= n) {
                        stringBuilder.append(shorterSeq[j]);
                        stringBuilder.append(" ");
                    }
                }
            }

            System.out.println(stringBuilder.toString());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Solution {
    private static int[] repSeq = {1, 4, 2, 6, 3, 5};
    private static int[] longerSeq = {1, 3, 6, 2, 4, 7, 9, 5, 8, 10};
    private static int[] shorterSeq = {6, 3, 1, 4, 2, 5};

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(br.readLine());
        for (int i = 0; i < t; i++) {
            int n = Integer.parseInt(br.readLine());
            StringBuilder stringBuilder = new StringBuilder();
            while (n > 12) {
                for (int j = 0; j < 5; j++) {
                    stringBuilder.append(n - repSeq[j] + 1);
                    stringBuilder.append(" ");
                }
                n -= 6;
            }

            if (n > 10) {
                for (int j = 0; j < 5; j++) {
                    stringBuilder.append(n - repSeq[j] + 1);
                    stringBuilder.append(" ");
                }
                if (n == 12)
                    stringBuilder.append("6 3 5 1 4 2");
                else
                    stringBuilder.append("5 2 4 1 3");
            } else if (n > 6) {
                for (int j = 0; j < 10; j++) {
                    int num = n + 1 - longerSeq[j];
                    if (num > 0) {
                        stringBuilder.append(num);
                        stringBuilder.append(" ");
                    }
                }
            } else if (n == 2 || n == 3) {
                stringBuilder.append("-1");
            } else {
                for (int j = 0; j < 6; j++) {
                    if (shorterSeq[j] <= n) {
                        stringBuilder.append(shorterSeq[j]);
                        stringBuilder.append(" ");
                    }
                }
            }

            System.out.println(stringBuilder.toString());
        }
    }
}


import java.util.Scanner;

public class SolutionG {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int t = scanner.nextInt(), n;

		for (int l = 0; l < t; l++) {
			n = scanner.nextInt();

			if (n == 2 || n == 3) {
				System.out.println("-1");
			}

			else {
				int start = (n % 2 != 0) ? n : n - 1;

				for (int i = start; i > 0; i -= 2) {
					System.out.print(i + " ");
				}

				System.out.print("4 2 ");

				for (int i = 6; i <= n; i += 2) {
					System.out.print(i + " ");
				}

				System.out.println();
			}
		}

		scanner.close();

	}

}


import java.io.*;
import java.util.InputMismatchException;

public class Main2 {
    public static void main(String[] xps){
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        StringBuilder sb = new StringBuilder();

        int t = in.Int();
        while (t-->0){
            int n = in.Int();
            if (n < 4) {
                sb.append(-1);
                sb.append("\n");
            }else{
                for (int i = n; i >= 1; i--) {
                    if (i % 2 !=0)
                        sb.append(i+" ");
                }
                sb.append(4+" "+2+" ");
                if (n < 6){
                    sb.append("\n");
                    continue;
                }else{
                    for (int i = 6; i <= n; i++) {
                        if (i % 2==0)
                            sb.append(i+" ");
                    }
                }
                sb.append("\n");
            }
        }
        out.println(sb);
        out.close();
    }

    private static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int Int() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String String() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public double Double() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            double res = 0;
            while (!isSpaceChar(c) && c != '.') {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, Int());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            }
            if (c == '.') {
                c = read();
                double m = 1;
                while (!isSpaceChar(c)) {
                    if (c == 'e' || c == 'E') {
                        return res * Math.pow(10, Int());
                    }
                    if (c < '0' || c > '9') {
                        throw new InputMismatchException();
                    }
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }

        public long Long() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public String next() {
            return String();
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
//        br = new BufferedReader(new FileReader(new File("input.txt")));
//        out = new PrintWriter(new File("output.txt"));
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        int PUTEN = nextInt();
        for (int POMOGI = 0; POMOGI < PUTEN; POMOGI++) {
            int n = nextInt();
            if (n <= 3) {
                out.println(-1);
                continue;
            }
            if (n == 4) {
                out.println("3 1 4 2");
                continue;
            }
            int[] a = new int[n];
            int p[] = new int[]{3, -2, 3, -2, 3};
            int cnt = 1;
            a[0] = 1;
            for (int i = 1; i < n - (n % 5); i++) {
                cnt += p[((i - 1) % 5)];
                a[i] = cnt;
            }
            int popka = n - (n % 5);
            int ind = n - (n % 5);
            if (n % 5 != 0) {
                a[ind - 2] = n - (n % 5) + 1;
                if (n % 5 == 4) {
                    a[ind] = popka + 2;
                    a[ind + 1] = popka + 4;
                    a[ind + 2] = popka;
                    a[ind + 3] = popka + 3;
                } else if (n % 5 == 3) {
                    a[ind] = popka + 2;
                    a[ind + 1] = popka;
                    a[ind + 2] = popka + 3;
                } else if (n % 5 == 2) {
                    a[ind] = popka + 2;
                    a[ind + 1] = popka;
                } else if (n % 5 == 1) {
                    a[ind] = popka;
                }
            }
            for (int i = 0; i < n; i++) {
                out.print(a[i] + " ");
            }
            out.println();
        }
        out.close();
    }

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer in = new StringTokenizer("");

    static String next() throws IOException {
        while (!in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}


import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) throws IOException {
//        br = new BufferedReader(new FileReader(new File("input.txt")));
//        out = new PrintWriter(new File("output.txt"));
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        int PUTEN = nextInt();
        for (int POMOGI = 0; POMOGI < PUTEN; POMOGI++) {
            int n = nextInt();
            if (n <= 3) {
                out.println(-1);
                continue;
            }
            int[] a = new int[n];
            int p[] = new int[]{3, -2, 3, -2, 3};
            int cnt = 1;
            a[0] = 1;
            for (int i = 1; i < n - (n % 5); i++) {
                cnt += p[((i - 1) % 5)];
                a[i] = cnt;
            }
            int popka = n - (n % 5);
            a[n - (n % 5) - 2] = n - (n % 5) + 1;
            int ind = n - (n % 5);
            if (n % 5 == 4) {
                a[ind] = popka + 2;
                a[ind + 1] = popka + 4;
                a[ind + 2] = popka;
                a[ind + 3] = popka + 3;
            } else if (n % 5 == 3) {
                a[ind] = popka + 2;
                a[ind + 1] = popka;
                a[ind + 2] = popka + 3;
            } else if (n % 5 == 2) {
                a[ind] = popka + 2;
                a[ind + 1] = popka;
            } else if (n % 5 == 1) {
                a[ind] = popka;
            }
            for (int i = 0; i < n; i++) {
                out.print(a[i] + " ");
            }
            out.println();
        }
        out.close();
    }

    static BufferedReader br;
    static PrintWriter out;
    static StringTokenizer in = new StringTokenizer("");

    static String next() throws IOException {
        while (!in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}


import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;

public class file
 {
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
	static INPUT sc = new INPUT(br);
	static int INF = Integer.MAX_VALUE,NEG_INF = Integer.MIN_VALUE,SEM_INF = INF / 2,count = 0,MOD = 1000000007,ops = 0;
    static long MAX_INF = Long.MAX_VALUE;
    static BigInteger B = new BigInteger("1");
    //static Scanner sc = new Scanner(System.in);
	public static void main (String[] args) throws Exception
	{
	    try{
            int t = sc.getInt(br.readLine());
            while(t-- > 0)
            {
                testCase();
            }
            out.flush();
        }catch(Exception e){
            System.out.println("Exception Occured!");
            e.printStackTrace();
        }
	}
    public static void testCase() throws Exception
    {
        int n = sc.nextInt();
        if(n <= 3){
            writeln(-1);
            return;
        }
        boolean c = false;
        if(n % 2 == 0){
            n--;
            c = true;
        }
        for(int x = n;x >= 1;x -= 2)
            write(x + " ");
        if(c)
            n++;
        write("4 2 ");
        for(int x = 6;x <= n;x += 2)
            write(x + " ");
        writeln();
    }

	public static void writeln() throws Exception
    {
        out.write("\n");
    }
    public static void write(Object o) throws Exception
    {
        out.write(String.valueOf(o));
    }
    public static void writeln(Object o) throws Exception
    {
        out.write(String.valueOf(o) + "\n");
    }
	public static void println()
    {
        System.out.println();
    }
	public static void print(Object o)
    {
        System.out.print(String.valueOf(o));
    }
    public static void println(Object o)
    {
        System.out.println(String.valueOf(o));
    }

}
class INPUT
{
    BufferedReader br;
    StringTokenizer st;

    public INPUT(BufferedReader br)
    {
        this.br = br;
    }

    /*RAW INPUTS*/

    public String next() throws Exception
    {
        if(st == null || !st.hasMoreElements())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public int nextInt() throws Exception
    {
        return Integer.parseInt(next());
    }

    public long nextLong() throws Exception
    {
        return Long.parseLong(next());
    }

    public String trimLine() throws Exception
    {
        try{
            return br.readLine().trim();
        }catch (Exception e){
            System.out.println("Exception Occured: " + e.getMessage());
            e.printStackTrace();
            return null;
        }
    }

    public String nextLine() throws Exception
    {
        try{
            return br.readLine();
        }catch (Exception e){
            System.out.println("Exception Occured: " + e.getMessage());
            e.printStackTrace();
            return null;
        }

    }

    public double nextDouble() throws Exception
    {
        return Double.parseDouble(next());
    }

    public float nextFloat() throws Exception
    {
        return Float.parseFloat(next());
    }

    public int  [] getIntArray( String s)
    {
        String input[] = s.split(" ");
        int res[] = new int[input.length];
        for(int x = 0;x < res.length;x++)
            res[x] = getInt(input[x]);

        return res;
    }
    public long  [] getLongArray( String s)
    {
        String input[] = s.split(" ");
        long res[] = new long[input.length];
        for(int x = 0;x < res.length;x++)
            res[x] = getLong(input[x]);

        return res;
    }

    public double  [] getDoubleArray( String s)
    {
        String input[] = s.split(" ");
        double res[] = new double[input.length];
        for(int x = 0;x < res.length;x++)
            res[x] = getDouble(input[x]);

        return res;
    }

    public int[][] getIntMatrix(String s,int r,int c)
    {
        int i = 0;int mat[][] = new int[r][c];
        String st[] = s.split(" ");
        for(int x = 0;x < r;x++)
            for(int y =0 ;y < c;y++)
                mat[x][y] = Integer.parseInt(st[i++]);
        return mat;

    }

    public long[][] getlongMatrix(String s,int r,int c)
    {
        int i = 0;long mat[][] = new long[r][c];
        String st[] = s.split(" ");
        for(int x = 0;x < r;x++)
            for(int y =0 ;y < c;y++)
                mat[x][y] = Long.parseLong(st[i++]);
        return mat;

    }

    public int getInt(String s)
    {
        return Integer.parseInt(s);
    }
    public long getLong(String s)
    {
        return Long.parseLong(s);
    }
    public float getFloat(String s)
    {
        return Float.parseFloat(s);
    }
    public double getDouble(String s)
    {
        return Double.parseDouble(s);
    }

}


import java.io.*;

public class SpecialParmulation {
	public static void main(String args[]) throws Exception{
		// BufferedReader br = new BufferedReader(new FileReader(new File("input.txt")));
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int T = readSingleInt(br);
		for(int tc=0; tc<T;tc++){
			int N = readSingleInt(br);
			log(getSpecialParmutation(N));
		}
	}

	private static int[] getSpecialParmutation(int N){
		int[] list = new int[N];
		if(place(list,N,0)){
	       		return list;
		}else {
			int[] A = new int[1];
			A[0] = -1;
			return A;
		}
	}

	private static boolean place(int[] list,int N, int index){
		if(index<N){
			for(int i=1;i<=N;i++){
				list[index] = i;
				if(isValid(list,index) && place(list,N,index+1)){
					return true;
				}
			}
			return false;
		}else {
			return true;
		}
	}

	private static boolean isValid(int[] list,int index){
		if(index==0) return true;
		else {
			int diff = Math.abs(list[index]-list[index-1]);
			if(diff>1 && diff<5) {
				for(int i=0;i<index;i++){
					if(list[index]==list[i]){
						return false;
					}
				}
				return true;
			}else {
				return false;
			}
		}
	}

	private static int readSingleInt(BufferedReader br) throws Exception{
		return Integer.parseInt(br.readLine());
	}

	private static void log(int[] list){
		for(int i=0; i<list.length;i++){
			System.out.print(list[i]+" ");
		}
		System.out.println();
	}
}


import java.util.Scanner;

public class Sp1352G {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		int t = scanner.nextInt();
		for (int i = 0; i < t; i++) {
			int n = scanner.nextInt();
			int[] a  = new int[n];
			if(n == 2|| n==3) {
				System.out.println(-1);
				continue;
			}
			else if(n==4) {
				System.out.print(3+" "+1+" "+4+" "+2);
				System.out.println();
				continue;
			}
			else if(n==5) {
				System.out.print(5+" "+3+" "+1+" "+4+" "+2);
				System.out.println();
				continue;
			}

			else {

				if(n%2 == 1) {
					int j = 0;
					for(; j<=n/2; j++) {
						a[j] = n - 2*j;
						System.out.print(a[j] + " ");
					}
					a[j] = 4;
					System.out.print(a[j] + " ");
					j++;
					a[j] = 2;
					System.out.print(a[j] + " ");
					j++;
					a[j] = 6;
					System.out.print(a[j] + " ");
					j++;
					for(; j<n;j++) {
						a[j] = a[j-1] + 2;
						System.out.print(a[j] + " ");
					}
					System.out.println();
				}
				else {
					int j = 0;
					for(; j<n/2; j++) {
						a[j] = n - 2*j - 1;
						System.out.print(a[j] + " ");
					}
					a[j] = 4;
					System.out.print(a[j] + " ");
					j++;
					a[j] = 2;
					System.out.print(a[j] + " ");
					j++;

					a[j] = 6;
					System.out.print(a[j] + " ");
					j++;
					for(; j<n;j++) {
						a[j] = a[j-1] + 2;
						System.out.print(a[j] + " ");
					}
					System.out.println();
				}
			}
 		}
		scanner.close();
	}

}


/*
ID: davidzh8
PROG: subset
LANG: JAVA
 */

import java.io.*;
import java.util.*;
import java.lang.*;

public class specialpermutation {
    //Start Stub
    static long startTime = System.nanoTime();
    //Globals Go Here

    //Globals End
    public static void main(String[] args) throws IOException {
        FastScanner sc = new FastScanner("specialpermutation.in", true);
        FastWriter pw = new FastWriter("specialpermutation.out", true);
        int tcs= sc.ni();
        while(tcs-->0){
            int N= sc.ni();
            if(N<4) System.out.println(-1);
            else{
                ArrayDeque<Integer> dq= new ArrayDeque<>();
                dq.addLast(3); dq.addLast(1); dq.addLast(4); dq.addLast(2);
                for (int i = 5; i <= N; i++) {
                    if(i%2==1) dq.addLast(i);
                    else dq.addFirst(i);
                }
                while(!dq.isEmpty()) System.out.print(dq.poll()+" ");
                System.out.println();
            }
        }

        /* End Stub */
        long endTime = System.nanoTime();
        //System.out.println("Execution Time: " + (endTime - startTime) / 1e9 + " s");
        pw.close();
    }

    static class Edge implements Comparable<Edge> {
        int w;
        int a;
        int b;

        public Edge(int w, int a, int b) {
            this.w = w;
            this.a = a;
            this.b = b;

        }

        public int compareTo(Edge obj) {
            if (obj.w == w) {
                if (obj.a == a) {
                    return b - obj.b;
                }
                return a - obj.a;
            } else return w - obj.w;
        }
    }

    static class Pair implements Comparable<Pair> {
        int a;
        int b;

        public Pair(int a, int b) {
            this.a = a;
            this.b = b;
        }

        public int compareTo(Pair obj) {
            if (obj.a == a) {
                return b - obj.b;
            } else return a - obj.a;
        }
    }

    static class SegmentTree {
        public long[] arr;
        public long[] tree;
        public int N;

        //Zero initialization
        public SegmentTree(int n) {
            N = n;
            arr = new long[N];
            tree = new long[4 * N + 1];
        }

        public long query(int treeIndex, int lo, int hi, int i, int j) {
            // query for arr[i..j]
            if (lo > j || hi < i)
                return 0;
            if (i <= lo && j >= hi)
                return tree[treeIndex];
            int mid = lo + (hi - lo) / 2;

            if (i > mid)
                return query(2 * treeIndex + 2, mid + 1, hi, i, j);
            else if (j <= mid)
                return query(2 * treeIndex + 1, lo, mid, i, j);

            long leftQuery = query(2 * treeIndex + 1, lo, mid, i, mid);
            long rightQuery = query(2 * treeIndex + 2, mid + 1, hi, mid + 1, j);

            // merge query results
            return merge(leftQuery, rightQuery);
        }

        public void update(int treeIndex, int lo, int hi, int arrIndex, long val) {
            if (lo == hi) {
                tree[treeIndex] = val;
                arr[arrIndex] = val;
                return;
            }

            int mid = lo + (hi - lo) / 2;

            if (arrIndex > mid)
                update(2 * treeIndex + 2, mid + 1, hi, arrIndex, val);
            else if (arrIndex <= mid)
                update(2 * treeIndex + 1, lo, mid, arrIndex, val);

            // merge updates
            tree[treeIndex] = merge(tree[2 * treeIndex + 1], tree[2 * treeIndex + 2]);
        }

        public long merge(long a, long b) {
            return (a + b);
        }
    }

    static class djset {
        int N;
        int[] parent;

        // Creates a disjoint set of size n (0, 1, ..., n-1)
        public djset(int n) {
            parent = new int[n];
            N = n;
            for (int i = 0; i < n; i++)
                parent[i] = i;
        }

        public int find(int v) {

            // I am the club president!!! (root of the tree)
            if (parent[v] == v) return v;

            // Find my parent's root.
            int res = find(parent[v]);

            // Attach me directly to the root of my tree.
            parent[v] = res;
            return res;
        }

        public boolean union(int v1, int v2) {

            // Find respective roots.
            int rootv1 = find(v1);
            int rootv2 = find(v2);

            // No union done, v1, v2 already together.
            if (rootv1 == rootv2) return false;

            // Attach tree of v2 to tree of v1.
            parent[rootv2] = rootv1;
            return true;
        }

    }

    static class FastScanner {
        public BufferedReader br;
        public StringTokenizer st;
        public InputStream is;

        public FastScanner(String name, boolean debug) throws IOException {
            if (debug) {
                is = System.in;
            } else {
                is = new FileInputStream(name);
            }
            br = new BufferedReader(new InputStreamReader(is), 32768);
            st = null;
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

        public int ni() {
            return Integer.parseInt(next());
        }

        public long nl() {
            return Long.parseLong(next());
        }

        public double nd() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return str;
        }
    }

    static class FastWriter {
        public PrintWriter pw;

        public FastWriter(String name, boolean debug) throws IOException {
            if (debug) {
                pw = new PrintWriter(System.out);
            } else {
                pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(name))));
            }
        }

        public void println(Object text) {
            pw.println(text);
        }

        public void print(Object text) {
            pw.print(text);
        }

        public void close() {
            pw.close();
        }

        public void flush() {
            pw.flush();
        }
    }

}