import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Soln7 {

	private static Scanner sc;

	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t > 0) {
			t--;
			int n = sc.nextInt();
			permutate(n);
		}
	}
	private static void permutate(int n ) {
		if(n < 4) {
			System.out.println("-1");
			return;
		}
		solution(n);
	}

	private static void solution(int n) {
		int start;
		if(n % 2 == 0) start = n - 1;
		else start = n;
		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();
	}

}


import java.util.*;
import java.util.stream.*;

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

        int t = scanner.nextInt();

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

            if (n <= 3) {
                System.out.println("-1");
            } else if (n == 4) {
                System.out.println("3 1 4 2");
            } else if (n == 5) {
                System.out.println("1 3 5 2 4");
            } else {
                List<Integer> numbers = new ArrayList<>();
                if (n % 2 != 0) {
                    for (int i = 1; i <= n; i+=2) {
                        numbers.add(i);
                    }
                    numbers.add(n - 3);
                    numbers.add(n - 1);
                    numbers.add(n - 5);

                    for (int i = n - 7; i >= 2; i-=2) {
                        numbers.add(i);
                    }
                } else {
                    for (int i = 1; i <= n - 4; i+=2) {
                        numbers.add(i);
                    }
                    numbers.add(n - 2);
                    numbers.add(n);
                    numbers.add(n - 3);
                    numbers.add(n - 1);
                    numbers.add(n - 4);
                    for (int i = n - 6; i >= 2; i += 2) {
                        numbers.add(i);
                    }
                }

                for (int i = 0; i < numbers.size(); i++) {
                    if (i == 0) {
                        System.out.print(numbers.get(i));
                    } else {
                        System.out.print(" " + numbers.get(i));
                    }
                }
                System.out.println();
            }
        }
    }
}


import java.util.*;
import java.util.stream.*;

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

        int t = scanner.nextInt();

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

            if (n <= 3) {
                System.out.println("-1");
            } else if (n == 4) {
                System.out.println("3 1 4 2");
            } else if (n == 5) {
                System.out.println("1 3 5 2 4");
            } else {
                List<Integer> numbers = new ArrayList<>();
                if (n % 2 != 0) {
                    for (int i = 1; i <= n; i+=2) {
                        numbers.add(i);
                    }
                    numbers.add(n - 3);
                    numbers.add(n - 1);
                    numbers.add(n - 5);

                    for (int i = n - 7; i >= 2; i-=2) {
                        numbers.add(i);
                    }
                } else {
                    for (int i = 1; i <= n - 4; i+=2) {
                        numbers.add(i);
                    }
                    numbers.add(n - 2);
                    numbers.add(n);
                    numbers.add(n - 3);
                    numbers.add(n - 1);
                    numbers.add(n - 4);
                    for (int i = n - 6; i >= 2; i -= 2) {
                        numbers.add(i);
                    }
                }

                for (int i = 0; i < numbers.size(); i++) {
                    if (i == 0) {
                        System.out.print(numbers.get(i));
                    } else {
                        System.out.print(" " + numbers.get(i));
                    }
                }
                System.out.println();
            }
        }
    }
}


import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public class specialpermutation implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new specialpermutation(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		int t = scan.nextInt();
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int n = sc.nextInt();
			ArrayList<Integer>ans = new ArrayList<Integer>();
			if(n<4) {
				out.println(-1);
				return;
			}
			for(int i = n;i>=1;n--) {
				if(i%2==1) {
					ans.add(i);
				}
			}
			ans.add(4);
			ans.add(2);
			for(int y = 6;y<n;y++) {
				if(y%2==0) {
					ans.add(y);
				}
			}
			for(int j = 0;j<ans.size();j++) {
				out.print(ans.get(j)+" ");

			}
			return;

    }
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		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.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public class specialpermutation implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new specialpermutation(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		int t = scan.nextInt();
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int n = sc.nextInt();
			ArrayList<Integer>ans = new ArrayList<Integer>();
			if(n<4) {
				out.println(-1);
				return;
			}
			for(int i = n;i>=1;i--) {
				if(i%2==1) {
					ans.add(i);
				}
			}
			ans.add(4);
			ans.add(2);
			for(int y = 6;y<=n;y++) {
				if(y%2==0) {
					ans.add(y);
				}
			}
			for(int j = 0;j<ans.size();j++) {
				out.print(ans.get(j)+" ");
			}
			out.println();
			return;

    }
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		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.*;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

public class specialpermutation implements Runnable{

    public static void main(String[] args) {
    	try{
            new Thread(null, new specialpermutation(), "process", 1<<26).start();
        }
        catch(Exception e){
            System.out.println(e);
        }
    }
	public void run() {
		FastReader scan = new FastReader();
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
		//PrintWriter out = new PrintWriter("file.out");
		Task solver = new Task();
		int t = scan.nextInt();
		for(int i = 1; i <= t; i++) solver.solve(i, scan, out);
		out.close();
	}

	static class Task {
		static final int inf = Integer.MAX_VALUE;

		public void solve(int testNumber, FastReader sc, PrintWriter out) {
			int n = sc.nextInt();
			ArrayList<Integer>ans = new ArrayList<Integer>();
			if(n<4) {
				out.println(-1);
				return;
			}
			for(int i = n;i>=1;i--) {
				if(i%2==1) {
					ans.add(i);
				}
			}
			ans.add(4);
			ans.add(2);
			for(int y = 6;y<n;y++) {
				if(y%2==0) {
					ans.add(y);
				}
			}
			for(int j = 0;j<ans.size();j++) {
				out.print(ans.get(j)+" ");
			}
			out.println();
			return;

    }
	}
	static long binpow(long a, long b, long m) {
		a %= m;
		long res = 1;
		while (b > 0) {
			if ((b & 1) == 1)
				res = res * a % m;
			a = a * a % m;
			b >>= 1;
		}
		return res;
	}
	static void sort(int[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static void sort(long[] x){
		shuffle(x);
		Arrays.sort(x);
	}
	static class tup implements Comparable<tup>, Comparator<tup>{
		int a, b;
		tup(int a,int b){
			this.a=a;
			this.b=b;
		}
		public tup() {
		}
		@Override
		public int compareTo(tup o){
			return Integer.compare(b,o.b);
		}
		@Override
		public int compare(tup o1, tup o2) {
			return Integer.compare(o1.b, o2.b);
		}

		@Override
	    public int hashCode() {
			return Objects.hash(a, b);
	    }

	    @Override
	    public boolean equals(Object obj) {
	    	if (this == obj)
                return true;
	    	if (obj == null)
                return false;
	    	if (getClass() != obj.getClass())
                return false;
	    	tup other = (tup) obj;
	    	return a==other.a && b==other.b;
	    }

	    @Override
	    public String toString() {
	    	return a + " " + b;
	    }
	}

	static void shuffle(int[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			int temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static void shuffle(long[] a) {
		Random get = new Random();
		for (int i = 0; i < a.length; i++) {
			int r = get.nextInt(a.length);
			long temp = a[i];
			a[i] = a[r];
			a[r] = temp;
		}
	}

	static class FastReader {
		BufferedReader br;
		StringTokenizer st;

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

		public FastReader(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(new File(s)));
		}

		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.util.*;
import java.io.*;
public class Problem7{
    StringTokenizer st;
    BufferedReader br;
    public void run() throws Exception{
        br = new BufferedReader(new InputStreamReader(System.in));
        int t = in();
        while(t-- > 0){
            int n = in(), l = 0, r = n-1, e = 1, tp;
            if(n < 4){
                System.out.println(-1);
                continue;
            }
            int[] arr = new int[n];
            int m = n%2 == 0 ? (n/2)-1 : (n/2)+1;
            while(l <= r){
                arr[l++] = e++;
                if(l > r) break;
                arr[r--] = e++;
            }
            if(n%2 == 0){
                tp = arr[m];
                arr[m] = arr[m-1];
                arr[m-1] = tp;
            }
            else{
                tp = arr[m];
                arr[m] = arr[m+1];
                arr[m+1] = tp;
            }
            for(int el: arr)
                System.out.print(el + " ");
            System.out.print("\n");
        }
    }
    Integer in() throws Exception{
        return Integer.parseInt(nextToken());
    }
    String nextToken() throws Exception{
        if(st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }
    public static void main(String[] args) throws Exception{
        new Problem7().run();
    }
}


import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;

public class Main{
	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[64]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}
	public static void print(int x,int n,PrintWriter out)
	{
		for(int i=0;i<n;i++)
			out.print(x+" ");
	}
	public static void main(String[] args) throws IOException {
		Reader scan = new Reader();
		PrintWriter out = new PrintWriter(System.out,true);
		int t=scan.nextInt();
		while(t-->0)
		{
			int n=scan.nextInt();
			if(n<=3)
			{
				out.println("-1");
				continue;
			}
			if(n==4)
			{
				out.println("3 1 4 2 ");
				continue;
			}
			int i=1;
			for(;i<=n;i+=2)
			{
				out.print(i+" ");
			}
			i=i-5;
			out.print(i+" ");
			if(n%2==0)
				out.print(n+" ");
			i=i+2;
			out.print(i+" ");
			for(i=i-4;i>=1;i=i-2)
				out.print(i+" ");
			out.println();
		}
	}
}


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;
import java.util.stream.Collectors;

public class ProbG {

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

        int t = sc.nextInt();
        var input = new int[t];
        for (int i = 0; i < t ; i++) {
            input[i] = sc.nextInt();
        }
        for (int i = 0; i < t ; i++) {
            process(input[i]);
        }

        out.close();
    }

    private static void process(int number) {
        var output = new ArrayList<Integer>();
        if(number<4){
            out.println(-1);
            return;
        }
        int start = number%2==0 ? number -1 : number;
        while(start>0) {
            output.add(start);
            start = start-2;
        }
        output.add(4);
        output.add(2);
        if(number>5) {
            start = 6;
            while(start<=number){
                output.add(start);
                start = start+2;
            }
        }
        out.println(output.stream().map(String::valueOf).collect(Collectors.joining(" ")));
    }

    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public 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.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;
import java.util.stream.Collectors;

public class ProbG {

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

        int t = sc.nextInt();
        var input = new int[t];
        for (int i = 0; i < t ; i++) {
            input[i] = sc.nextInt();
        }
        for (int i = 0; i < t ; i++) {
            process(input[i]);
        }

        out.close();
    }

    private static void process(int number) {
        var output = new ArrayList<Integer>();
        if(number<4){
            out.println(-1);
            return;
        }
        int start = number%2==0 ? number -1 : number;
        while(start>0) {
            output.add(start);
            start = start-2;
        }
        output.add(4);
        output.add(2);
        if(number>5) {
            start = 6;
            while(start<number){
                output.add(start);
                start = start+2;
            }
        }
        out.println(output.stream().map(String::valueOf).collect(Collectors.joining(" ")));
    }

    //-----------PrintWriter for faster output---------------------------------
    public static PrintWriter out;

    //-----------MyScanner class for faster input----------
    public 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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int t= Integer.parseInt(br.readLine());

		while(t!=0) {
			t--;

			int n= Integer.parseInt(br.readLine());
			if(n<=3) {
				System.out.println("-1");
			}else {
				int r[];
				r = calculateVal(n);
				for(int i=0;i<n;i++) {
					System.out.print(r[i]+" ");
				}
				System.out.println();
			}
		}
	}

	public static int[] calculateVal(int n) {
		int result[] = new int[n];
		int start=0; int end =n-1;
		for(int i=n;i>=1;i--) {
			if(i%2!=0) {
				result[start]= i;
				start++;
			}else {
				result[end]=i;
				end--;
			}
		}
		int t= result[start];
		result[start] = result[start+1];
		result[start+1]=t;
		return result;
	}
}


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

public class Q7 {
/*
Testcase

 */

    public static StringBuffer solver(FastReader sc) throws IOException {
        StringBuffer ans = new StringBuffer();
        int n = sc.nextInt();
//        ArrayList<Long> arr = new ArrayList<>();
        if(n<4)
            return ans.append(-1);

        Deque<Integer> dq = new LinkedList<>();

        for(int i=2;i<=n;i+=2){
            if(i==2)
                dq.addFirst(4);
            else if(i==4)
                dq.addFirst(2);
            else
                dq.addFirst(i);
        }

        for(int i=1;i<=n;i+=2){
            dq.addLast(i);
        }

        Iterator i = dq.iterator();
        while(i.hasNext()){
            ans.append(i.next()+" ");
        }

        return ans;
    }

    public static void main(String[] args) throws IOException {
        FastReader sc = new FastReader();
        int test = sc.nextInt();

        for (int t = 0; t < test; t++) {
            String val = String.valueOf(solver(sc));
            System.out.println(val);

        }

    }

    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 sol {
    InputReader in;
    PrintWriter out;
    helper_class h;
    final long mod=1000000007;
    public static void main(String[] args) throws java.lang.Exception{
        new sol().run();
    }
    void run() throws Exception{
        in=new InputReader(System.in);
        out = new PrintWriter(System.out);
        h = new helper_class();
        int t=h.ni();
        while(t-->0){
            solve();
        }
        out.flush();
        out.close();
    }
    int n,i,j;
    int[] a;
    void solve(){
        n=h.ni();
        if(n<4) {
            out.println(-1);
            return;
        }
        int x;
        i=1;
        a=new int[n+1];
        if(n%2==1)
            x=n;
        else
            x=n-1;
        while(x>0) {
            a[i++]=x;
            x-=2;
        }
        a[i++]=4;
        a[i++]=2;
        x=6;
        while(x<=n) {
            a[i++]=x;
            x+=2;
        }
        for(i=1;i<=n;i++)
            out.print(a[i]+" ");
        out.println();
    }
    class helper_class{
        long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
        int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
        int bitcount(long n){return (n==0)?0:(1+bitcount(n&(n-1)));}
        void p(Object o){out.print(o);}
        void pn(Object o){out.println(o);}
        void pni(Object o){out.println(o);out.flush();}
        String n(){return in.next();}
        String nln(){return in.nextLine();}
        int ni(){return in.nextInt();}
        long nl(){return in.nextLong();}
        double nd(){return in.nextDouble();}
        long power(long a, long b){
            if(b == 0)
                return 1L;
            long val = power(a, b / 2);
            if(b % 2 == 0)
                return val * val%mod;
            else
                return val * val%mod * a%mod;
        }
    }
    class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        public InputReader(InputStream stream) {
            this.stream = stream;
        }
        public int read() {
            if (numChars == -1)
                throw new UnknownError();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }
        public int peek() {
            if (numChars == -1)
                return -1;
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    return -1;
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar];
        }
        public void skip(int x) {
            while (x-->0)
                read();
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public String nextString() {
            return next();
        }
        public String next() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            StringBuffer res = new StringBuffer();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));

            return res.toString();
        }
        public String nextLine() {
            StringBuffer buf = new StringBuffer();
            int c = read();
            while (c != '\n' && c != -1) {
                if (c != '\r')
                    buf.appendCodePoint(c);
                c = read();
            }
            return buf.toString();
        }
        public double nextDouble() {
            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, nextInt());
                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, nextInt());
                    if (c < '0' || c > '9')
                        throw new InputMismatchException();
                    m /= 10;
                    res += (c - '0') * m;
                    c = read();
                }
            }
            return res * sgn;
        }
        public boolean hasNext() {
            int value;
            while (isSpaceChar(value = peek()) && value != -1)
                read();
            return value != -1;
        }
        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}


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

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(n%2 != 0){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=n;i>=1;i--){
                    if(n%2 == 0){
                        System.out.println(i+" ");
                    }
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i++){
                    if(n%2 != 0){
                        System.out.println(i+" ");
                    }
                }
                for(int i=n;i>=1;i++){
                    if(n%2 == 0){
                        System.out.println(i+" ");
                    }
                }
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(n%2 != 0){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=n;i>=1;i--){
                    if(n%2 == 0 && n != 2 && n != 4){
                        System.out.print(i+" ");
                    }
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(i&1 == 1){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=6;i<=n;i=i+2){
                    System.out.print(i+" ");
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(i%2 != 0){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=6;i<=n;i=i+2){
                    System.out.print(i+" ");
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(i & 1){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=6;i<=n;i=i+2){
                    System.out.print(i+" ");
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(n%2 != 0){
                        System.out.print(i+" ");
                    }
                }
                System.out.print("4 2 ");
                for(int i=6;i<=n;i++){
                    if(n%2 == 0){
                        System.out.print(i+" ");
                    }
                }
                System.out.println();
            }
       }
    }
}

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.*;

public class c_1352G{
    static FastReader fr = new FastReader();
    public static void main(String[] args){
       int t = fr.nextInt();
       while(t-- > 0){
            int n = fr.nextInt();
            if(n < 4){
                System.out.println("-1");
            }else{
                for(int i=n;i>=1;i--){
                    if(n%2 != 0){
                        System.out.println(i+" ");
                    }
                }
                for(int i=n;i>=1;i--){
                    if(n%2 == 0){
                        System.out.println(i+" ");
                    }
                }
            }
       }
    }
}

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.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;

public class Solution{

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

		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		int tt = fs.nextInt();
		while(tt-->0) {
			int n = fs.nextInt();

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

			int p = (n%2==0)?n-1:n;

			for(int i=p;i>0;i=i-2) out.print(i+" ");;
			out.print("4 2 ");
			for(int i=6;i<=n;i=i+2) out.print(i+" ");
			out.println("");

		}

		out.close();
	}

	static final Random random=new Random();

	static void ruffleSort(int[] a) {
		int n=a.length;//shuffle, then sort
		for (int i=0; i<n; i++) {
			int oi=random.nextInt(n), temp=a[oi];
			a[oi]=a[i]; a[i]=temp;
		}
		Arrays.sort(a);
	}

	static class FastScanner{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

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

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

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

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

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

}


	import java.util.*;

import java.io.*;
	import java.math.*;
	import java.awt.geom.*;

	import static java.lang.Math.*;

	 public class Solution implements Runnable {

	    public void solve() throws Exception {

	    	int t=sc.nextInt();
	    	while(t-->0)
	    	{
	    		int n=sc.nextInt();
	    		if(n<=3)
	    		{
	    			out.println(-1);
	    		}
	    		else
	    		{
	    			if(n%4==0 || n%4==1)
	    			{
	    				for(int i=1;i<=n/4;i++)
	    				{
	    					int first=(i-1)*4+1;
	    					out.print((first+1)+" "+(first+3)+" "+(first)+" "+(first+2)+" ");
	    				}
	    				if(n%4==1)
	    				{
	    					out.print(n);
	    				}
	    			}
	    			else
	    			{
	    				if(n%4==2)
		    			{
		    				print(n-6);
		    				int f=n-6;
		    				out.print((f+2)+" "+(n)+" "+(f+4)+" "+(f+1)+" "+(f+3)+" "+(f+5));
		    			}
	    				if(n%4==3)
	    				{
	    					print(n-7);
	    					int f=n-7;
	    					out.print((f+2)+" "+(n-1)+" "+(f+4)+" "+(f+1)+" "+(f+3)+" "+n+" "+(f+5));

	    				}
	    			}
	    			out.println();
	    		}

	    			}
	    		}

	    		public void print(int n)
	    		{
	    			for(int i=1;i<=n/4;i++)
    				{
    					int first=(i-1)*4+1;
    					out.print((first+1)+" "+(first+3)+" "+(first)+" "+(first+2)+" ");
    				}
	    		}

	    static long power(long x, long y, long p)
	    {

	        long res = 1;

	        x = x % p;

	       if (x == 0) return 0;

	        while (y > 0)
	        {
	            if((y & 1)==1)
	                res = (res * x) % p;
	            y = y >> 1;
	            x = (x * x) % p;
	        }
	        return res;
	    }

	    static Throwable uncaught;

	    BufferedReader in;
	    FastScanner sc;
	    PrintWriter out;

	    @Override
	    public void run() {
	        try {
	            in = new BufferedReader(new InputStreamReader(System.in));
	            out = new PrintWriter(System.out);
	            sc = new FastScanner(in);
	            solve();
	        } catch (Throwable uncaught) {
	            Solution.uncaught = uncaught;
	        } finally {
	            out.close();
	        }
	    }

	    public static void main(String[] args) throws Throwable {
	        Thread thread = new Thread(null, new Solution(), "", (1 << 26));
	        thread.start();
	        thread.join();
	        if (Solution.uncaught != null) {
	            throw Solution.uncaught;
	        }
	    }

	}

	class FastScanner {

	    BufferedReader in;
	    StringTokenizer st;

	    public FastScanner(BufferedReader in) {
	        this.in = in;
	    }

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

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

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

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

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

	}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author unknown
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        GSpecialPermutation solver = new GSpecialPermutation();
        solver.solve(1, in, out);
        out.close();
    }

    static class GSpecialPermutation {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int ntc = in.nextInt();
            while ((ntc--) > 0) {
                int n = in.nextInt();
                if (n < 4) {
                    out.println(-1);
                } else {
                    StringBuilder ans = new StringBuilder();
                    ans.append("2 4 1 3 ");
                    for (int i = 5; i <= n; i++) {
                        if (i % 2 == 1) {
                            ans.insert(0, i + " ");
                        } else {
                            ans.append(i).append(" ");
                        }
                    }
                    out.println(ans);
                }
            }
        }

    }

    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 println(Object... objects) {
            print(objects);
            writer.println();
        }

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

        public void println(long i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.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 nextInt() {
            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 boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

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

        }

    }
}


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

public class SpecialPermutation {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int t = Integer.parseInt(br.readLine());
		StringBuilder sb = new StringBuilder();

		while (t-- > 0) {
			int n = Integer.parseInt(br.readLine());

			if (n < 4) {
				sb.append(-1);
			} else {
				Deque<Integer> res = new ArrayDeque<>();
				res.add(3);
				res.add(1);
				res.add(4);
				res.add(2);
				for (int i = 5; i <= n; i++) {
					if (i - res.peek() == 2) {
						res.addFirst(i);
					} else {
						res.add(i);
					}
				}
				for (int i: res) {
					sb.append(i);
					sb.append(' ');
				}
			}

			sb.append('\n');
		}

		br.close();

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


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

public class SpecialPermutation {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		InputStreamReader read = new InputStreamReader(System.in);
		BufferedReader in = new BufferedReader(read);

		int t = Integer.parseInt(in.readLine());
		while(t-->0){
			int n = Integer.parseInt(in.readLine());
			if(n<4) {
				System.out.println(-1);
				continue;
			}
			int m = n;

			if(m%2==0)
				m--;

			while(m>0) {
				System.out.print(m+" ");
				m-=2;
			}

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

			m = 6;

			while(m<=n)
			{
				System.out.print(m+" ");
				m+=2;
			}

			System.out.println();

		}
	}

}


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

public class CF_G_1352
{
    public static void main(String[] args) throws IOException
    {
        int t = readInt();
        for (int __ = 0; __ < t; __++)
        {
            int n = readInt();
            if (n <= 3)
            {
                System.out.println("-1");
                continue;
            }
            StringBuilder result = new StringBuilder();
            boolean odd = n % 2 != 0;
            for (int i = n; i >= (odd ? 5 : 6); i -= 2)
            {
                result.append(i + " ");
            }
            result.append("2 4 1 3 ");
            for (int i = odd ? 6 : 5; i < n; i += 2)
            {
                result.append(i + " ");
            }
            System.out.println(result);
        }
    }

    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer st;

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


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

public class Today {
	static void solve() throws IOException {
		int n = nextInt();
		if(n < 4) {
			out.println(-1);
			return;
		}
		for(int i = n % 2 != 0 ? n : n - 1; i >= 1; i -= 2)
			out.print(i + " ");
		out.print("4 2 ");
		for(int i = 6; i <= n; i += 2)
			out.print(i + " ");
		out.println();
	}

	public static void main(String args[]) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(new BufferedOutputStream(System.out));
		// sieve();
		int tt = nextInt();
		// int tt = 1;
		for(int test = 1; test <= tt; ++test) {
			// out.print("Case #" + test + ": ");
			solve();
		}
		out.close();
	}

	// static final int MAXN = 100001;
	// static int spf[] = new int[MAXN];

	// static void sieve() {
	// 	spf[1] = 1;
	// 	for (int i = 2; i < MAXN; i++)
	// 		spf[i] = i;
	// 	for (int i = 4; i < MAXN; i += 2)
	// 		spf[i] = 2;

	// 	for (int i = 3; i * i < MAXN; i++) {
	// 		if (spf[i] == i) {
	// 			for (int j = i * i; j < MAXN; j += i)
	// 				if (spf[j] == j)
	// 					spf[j] = i;
	// 		}
	// 	}
	// }

	static final long mod = (long) (1e9 + 7);
	static final int inf = (int) (1e9 + 1);

	static class Pair implements Comparable<Pair> {
		int first, second;

		Pair(int a, int b) {
			first = a;
			second = b;
		}

		public int compareTo(Pair p) {
			return this.first - p.first;
		}

		public boolean equals(Object p) {
			Pair p1 = (Pair) p;
			return (first == p1.first && second == p1.second);
		}

		public String toString() {
			return this.first + " " + this.second;
		}

		public int hashCode() {
			return (int) ((1l * (inf + 1) * this.first + this.second) % mod);
		}
	}

	public static int lowerBound(int[] array, int length, int value) {
		int low = 0;
		int high = length;
		while (low < high) {
			final int mid = (low + high) / 2;
			if (value <= array[mid]) {
				high = mid;
			} else {
				low = mid + 1;
			}
		}
		return low;
	}

	public static int upperBound(int[] array, int length, int value) {
		int low = 0;
		int high = length;
		while (low < high) {
			final int mid = (low + high) / 2;
			if (value >= array[mid]) {
				low = mid + 1;
			} else {
				high = mid;
			}
		}
		return low;
	}

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

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

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

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

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

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

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

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

	static int[] memset(int n, int val) {
		int ar[] = new int[n];
		Arrays.fill(ar, val);
		return ar;
	}

	static void debug(Object... a) {
		System.out.print("> ");
		for (int i = 0; i < a.length; i++)
			System.out.print(a[i] + " ");
		System.out.println();
	}

	static void debug(int a[]) {
		debugnsp(Arrays.stream(a).boxed().toArray());
	}

	static void debug(long a[]) {
		debugnsp(Arrays.stream(a).boxed().toArray());
	}

	static void debugnsp(Object a[]) {
		System.out.print("> ");
		for (int i = 0; i < a.length; i++)
			System.out.print(a[i] + " ");
		System.out.println();
	}
}

/*
 * Jai Sita Ram Ji
 *
 * @author: Nishchal Siddharth Pandey
 */


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

public class Main
{
    static boolean can_form(ArrayList<Integer> li,int n){
        if(li.size()==n){
            for(Integer i : li)
                p(i+" ");
            pn("");
            return true;
        }

        int sz=li.size(),lst=li.get(sz-1);

        for(int i=2;i<=4;i++){
            if(lst+i>n)
                continue;

            if(!li.contains(lst+i)){
                ArrayList<Integer> clo = new ArrayList<>();
                clo.addAll(li);
                clo.add(lst+i);//System.out.println("Had "+li);
                //System.out.println("formed :+"+clo);
                if(can_form(clo,n))
                    return true;
            }
        }

        for(int i=2;i<=4;i++){

            if(lst-i<1)
                continue;
            if(!li.contains(lst-i)){
                ArrayList<Integer> clo = new ArrayList<>();
                clo.addAll(li);
                clo.add(lst-i);//System.out.println("Had "+li);
                //System.out.println("formed :+"+clo);
                if(can_form(clo,n))
                    return true;
            }
        }

        return false;
    }

    public static void process()throws IOException
    {
        int n=ni();

        for(int i=1;i<=n;i++){
            ArrayList<Integer> li = new ArrayList<>();
            li.add(i);//System.out.println(li);
            if(can_form(li,n)){
                return;
            }
        }
        pn(-1);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

        oj = System.getProperty("ONLINE_JUDGE") != null;
        if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
        t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


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

public class Main
{
    public static void process()throws IOException
    {
        int n = ni();

        if(n == 1)
            pn(1);
        else if(n <= 3)
            pn(-1);
        else if( n == 4)
            pn("2 4 1 3");
        else{
            for(int i = n - 1 + (n&1); i >= 1; i-=2)
                p(i+" ");
            p("4 2 ");
            for(int i = 6; i <= n; i+=2)
                p(i+" ");
            p("\n");
        }
    }

    static final long mod=(long)1e9+7l;

    static FastReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new FastReader();

        long s = System.currentTimeMillis();
        int t=1;
        t=ni();
        while(t-->0)
            process();

        out.flush();
        System.err.println(System.currentTimeMillis()-s+"ms");
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static int ni()throws IOException{return Integer.parseInt(sc.next());}
    static long nl()throws IOException{return Long.parseLong(sc.next());}
    static double nd()throws IOException{return Double.parseDouble(sc.next());}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}

    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();
        }

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


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

public class Main
{

    public static void process()throws IOException
    {
    	int n=ni();
    	if(n<4){
    		pn(-1);
    		return;
    	}

    	StringBuilder res = new StringBuilder();

    	for(int i=n;i>=1;i--)
    		if((i & 1)==1)
    			res.append(i+" ");

    	res.append("4 2 ");
    	for(int i=6;i<=n;i+=2)
    		res.append(i+" ");
    	pn(res);
    }

    static AnotherReader sc;
    static PrintWriter out;
    public static void main(String[]args)throws IOException
    {
        out = new PrintWriter(System.out);
        sc=new AnotherReader();
        boolean oj = true;

    	oj = System.getProperty("ONLINE_JUDGE") != null;
    	if(!oj) sc=new AnotherReader(100);

        long s = System.currentTimeMillis();
        int t=1;
		t=ni();
        while(t-->0)
            process();
        out.flush();
        if(!oj)
            System.out.println(System.currentTimeMillis()-s+"ms");
        System.out.close();
    }

    static void pn(Object o){out.println(o);}
    static void p(Object o){out.print(o);}
    static void pni(Object o){out.println(o);System.out.flush();}
    static int ni()throws IOException{return sc.nextInt();}
    static long nl()throws IOException{return sc.nextLong();}
    static double nd()throws IOException{return sc.nextDouble();}
    static String nln()throws IOException{return sc.nextLine();}
    static long gcd(long a, long b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int gcd(int a, int b)throws IOException{return (b==0)?a:gcd(b,a%b);}
    static int bit(long n)throws IOException{return (n==0)?0:(1+bit(n&(n-1)));}
    static boolean multipleTC=false;
    static long mod=(long)1e9+7l;

    static void r_sort(int arr[],int n){
        Random r = new Random();
        for (int i = n-1; i > 0; i--){
            int j = r.nextInt(i+1);

            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }
        Arrays.sort(arr);
    }

    static long mpow(long x, long n) {
        if(n == 0)
            return 1;
        if(n % 2 == 0) {
            long root = mpow(x, n / 2);
            return root * root % mod;
        }else {
            return x * mpow(x, n - 1) % mod;
        }
    }

    static long mcomb(long a, long b) {
        if(b > a - b)
            return mcomb(a, a - b);
        long m = 1;
        long d = 1;
        long i;
        for(i = 0; i < b; i++) {
            m *= (a - i);
            m %= mod;
            d *= (i + 1);
            d %= mod;
        }
        long ans = m * mpow(d, mod - 2) % mod;
        return ans;
    }
/////////////////////////////////////////////////////////////////////////////////////////////////////////

    static class AnotherReader{BufferedReader br; StringTokenizer st;
    AnotherReader()throws FileNotFoundException{
    br=new BufferedReader(new InputStreamReader(System.in));}
    AnotherReader(int a)throws FileNotFoundException{
    br = new BufferedReader(new FileReader("input.txt"));}
    String next()throws IOException{
    while (st == null || !st.hasMoreElements()) {try{
    st = new StringTokenizer(br.readLine());}
    catch (IOException  e){ e.printStackTrace(); }}
    return st.nextToken(); } int nextInt() throws IOException{
    return Integer.parseInt(next());}
    long nextLong() throws IOException
    {return Long.parseLong(next());}
    double nextDouble()throws IOException { return Double.parseDouble(next()); }
    String nextLine() throws IOException{ String str = ""; try{
    str = br.readLine();} catch (IOException e){
    e.printStackTrace();} return str;}}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
}


import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {
    static String[][][] ans = new String[101][101][101];
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        while (num-- != 0) {
            int x = in.nextInt();
            System.out.println(fun(x));

        }
    }

    static String fun (int x) {
        if (x <= 3) return "-1";
        if (x == 4) return "3 1 4 2";
        StringBuffer bf = new StringBuffer("3 1 4 2 ");
        for (int i = 5; i <= x ; i++) {
            if (i % 2 == 1) { bf.insert(0, i + " "); }
            else { bf.append(i + " "); }

        }
        return bf.toString();
    }
}
class D {
    int x ;
    int y ;
    int z ;
    String data;
    public D (int x, int y, int z, String d) {
        this.x = x;
        this .y = y;
        this.z = z;
        this.data = d;
    }
}


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

	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader(){
			br=new BufferedReader(new InputStreamReader(System.in));
			out=new PrintWriter(System.out);
		}
		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;
		}
	}

    public static void main(String[] args)
    {
       FastReader scn = new FastReader();

      int t = scn.nextInt() ;

      for( int m = 1; m<=  t; m++){
       StringBuilder sb = new StringBuilder() ;

       int n= scn.nextInt() ;
       if( n < 4) sb.append(-1 +"\n") ;

       else{
           if(n% 2 == 0)
           {
               for( int j =  n-1  ; j >=1 ;j--)
               {
                   sb.append(j +" ") ;
                   j-- ;
               }

               sb.append(4 +" " + 2 +" ") ;

               for(int j = 6 ; j <= n ; j++)
               {
                    sb.append(j +" ") ;
                   j++ ;

               }

           }

           else{
              for( int j =  n  ; j >=1 ;j--)
               {
                   sb.append(j +" ") ;
                   j-- ;
               }

                sb.append(4 +" " + 2 +" ") ;

               for(int j = 6 ; j <= n - 1 ; j++)
               {
                    sb.append(j +" ") ;
                   j++ ;

               }

           }

       }

        System.out.println(sb) ;

      }

    }
}


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

}


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

public class Special_Permutation {
	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;
		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader t = new FastReader();
		PrintWriter o = new PrintWriter(System.out);
		int test = t.nextInt();

		while (test-- > 0) {
			int n = t.nextInt();

			if (n <= 3) {
				o.println("-1");
			} else {
				if ((n & 1) == 1) {
					int cur = 1;

					while (cur <= n) {
						o.print(cur + " ");
						cur += 2;
					}

					n -= (n / 2) + 1;
					cur -= 2;

					o.print((cur - 3) + " " + (cur - 1) + " ");
					n -= 2;

					if (n >= 1) {
						o.print(cur - 5 + " ");
						n--;
						cur = cur - 5;

						while (n-- > 0) {
							o.print(cur - 2 + " ");
							cur -= 2;
						}
					}

					o.println();

				} else {
					int cur = 2;

					while (cur <= n) {
						o.print(cur + " ");
						cur += 2;
					}

					n -= (n / 2);
					cur -= 2;

					o.print((cur - 3) + " " + (cur - 1) + " ");
					n -= 2;

					if (n >= 1) {
						o.print(cur - 5 + " ");
						n--;

						while (n-- > 0) {
							o.print(cur - 2 + " ");
							cur -= 2;
						}
					}

					o.println();
				}
			}
		}

		o.flush();
		o.close();
	}
}


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

public class Special_Permutation {
	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;
		}

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader t = new FastReader();
		PrintWriter o = new PrintWriter(System.out);
		int test = t.nextInt();

		while (test-- > 0) {
			int n = t.nextInt();

			if (n <= 3) {
				o.println("-1");
			} else {
				if ((n & 1) == 1) {
					int cur = 1;

					while (cur <= n) {
						o.print(cur + " ");
						cur += 2;
					}

					n -= (n / 2) + 1;
					cur -= 2;

					o.print((cur - 3) + " " + (cur - 1) + " ");
					n -= 2;

					if (n >= 1) {
						o.print(cur - 5 + " ");
						n--;
						cur = cur - 5;

						while (n-- > 0) {
							o.print(cur - 2 + " ");
							cur -= 2;
						}
					}

					o.println();

				} else {
					int cur = 2;

					while (cur <= n) {
						o.print(cur + " ");
						cur += 2;
					}

					n -= (n / 2);
					cur -= 2;

					o.print((cur - 3) + " " + (cur - 1) + " ");
					n -= 2;

					if (n >= 1) {
						o.print(cur - 5 + " ");
						n--;
						cur=cur-5;

						while (n-- > 0) {
							o.print(cur - 2 + " ");
							cur -= 2;
						}
					}

					o.println();
				}
			}
		}

		o.flush();
		o.close();
	}
}


import java.util.Scanner;

public class G {

	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);

		int num = input.nextInt();

		for(int i = 0; i < num; i++) {
			int arr = input.nextInt();
			if(arr <= 3)
				System.out.println("-1");
			else if(arr == 4)
				System.out.println("3 1 4 2");
			else {
				if(arr % 2 == 1) {
					for(int j = arr; j >= 1; j -= 2)
						System.out.print(j + " ");
					System.out.print("4 2 ");
					for(int j = 6; j <= arr; j += 2)
						System.out.print(j + " ");
				}
				if(arr % 2 == 0) {
					for(int j = arr; j >= 1; j -= 2)
						System.out.print(j + " ");
					System.out.print("5 1 3 ");
					for(int j = 7; j <= arr; j += 2)
						System.out.print(j + " ");

				}
				System.out.println();

			}
		}

	}

}


/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main

{
    static Scanner in = new Scanner(System.in);

    public static void solve()
    {
      int n=in.nextInt();

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

    }

	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here

		int t=in.nextInt();
		//in.nextLine();

		while(t>0)
		{

		   solve();
		    t--;
		}

	//	System.out.println(x);
	}
}


/* package codechef; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
public class Main

{
    static Scanner in = new Scanner(System.in);

    public static void solve()
    {
      int n=in.nextInt();

      if(n==4)
      {
          System.out.println("2 4 1 3");
      }
   else  if(n>3)
    {
        int k=1;

        if(n%2==0)
        {
             for(int i=1;i<=n-4;i=i+2,k=i)
        {
            System.out.print(i+" ");
        }
        System.out.print(k+2+" "+k+" ");
            for(int i=n;i>=2;i=i-2)
        {
            System.out.print(i+" ");
        }
        }
        else
        {

            for(int i=1;i<=n;i=i+2)
        {
            System.out.print(i+" ");
        }
         System.out.print(n-3+" "+(n-1)+" ");
            for(int i=n-5;i>=2;i=i-2)
        {
            System.out.print(i+" ");
        }
        }
        System.out.println();
    }
    else
    System.out.println(-1);

    }

	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here

		int t=in.nextInt();
		//in.nextLine();

		while(t>0)
		{

		   solve();
		    t--;
		}

	//	System.out.println(x);
	}
}


import java.util.*;

/**
 * 1352G
 */
public class RareCombinatory {
    public static void main(String[] s){
        HashMap<Integer, Integer[]> map = new HashMap<>();

        map.put(1, new Integer[]{1});
        map.put(2, new Integer[]{-1});
        map.put(3, new Integer[]{-1});
        map.put(4, new Integer[]{3, 1, 4, 2});

        Scanner input = new Scanner(System.in);
        int n = Integer.parseInt(input.nextLine());

        for(int i = 0; i < n; i++)
            System.out.println(getSequence(Integer.parseInt(input.nextLine()), map));
    }

    public static String getSequence(int amount, HashMap<Integer, Integer[]> map) {
        if(map.containsKey(amount))
            return replaceRedundant(Arrays.toString(map.get(amount)));

        for(int i = map.size()+1; i <= amount; i++)
            if(i%2 == 0)
                putInMap(i, 0, i-1, map);
            else
                putInMap(i, 0, i-1, map);

        return replaceRedundant(Arrays.toString(map.get(amount)));
    }

    public static void putInMap(int i, int destPos, int newPos, HashMap<Integer, Integer[]> map){
        Integer[] array = new Integer[i];
        array[newPos] = i;
        System.arraycopy(map.get(i-1), 0, array, destPos, i-1);
        map.put(i, array);
    }

    public static String replaceRedundant(String s){
        return s.replaceAll("]", "").replaceAll("\\[", "").replaceAll(",", "");
    }
}


import java.util.*;

/**
 * 1352G
 */
public class RareCombinatory {
    static HashMap<Integer, Integer[]> map = new HashMap<>();
    public static void main(String[] s){

        map.put(1, new Integer[]{1});
        map.put(2, new Integer[]{-1});
        map.put(3, new Integer[]{-1});
        map.put(4, new Integer[]{3, 1, 4, 2});

        Scanner input = new Scanner(System.in);
        int n = Integer.parseInt(input.nextLine());

        for(int i = 0; i < n; i++)
            System.out.println(getSequence(Integer.parseInt(input.nextLine())));
    }

    public static String getSequence(int amount) {
        if(map.containsKey(amount))
            return replaceRedundant(Arrays.toString(map.get(amount)));

        for(int i = map.size()+1; i <= amount; i++)
            if(i%2 == 0)
                putInMap(i, 1, 0);
            else
                putInMap(i, 0, i-1);

        return replaceRedundant(Arrays.toString(map.get(amount)));
    }

    public static void putInMap(int i, int destPos, int newPos){
        Integer[] array = new Integer[i];
        array[newPos] = i;
        System.arraycopy(map.get(i-1), 0, array, destPos, i-1);
        map.put(i, array);
    }

    public static String replaceRedundant(String s){
        return s.replaceAll("]", "").replaceAll("\\[", "").replaceAll(",", "");
    }
}


import java.util.*;
public class MyClass {
    public static void main(String args[]) {
     Scanner in=new Scanner(System.in);int t=0,n=0,n1=0,n2=0;
     if(in.hasNext())
     t=in.nextInt();
     for(int j=0;j<t;j++)
     {
         if(in.hasNext())
         n=in.nextInt();
         if(n<=3)
         System.out.println("-1");
         else
         {
             if(n%2!=0)
             {n1=n;n2=n-1;}
             else
             {n1=n-1;n2=n;}
             for(int i=n1;i>=1;i-=2)
             System.out.print(i+" ");
             System.out.print("4 2 ");
             for(int i=6;i<=n2;i+=2)
             System.out.print(i+" ");
             System.out.println();
         }
     }
    }
}