Problem: You are given one integer n (n > 1).

Recall that a permutation of length n is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2, 3, 1, 5, 4] is a permutation of length 5, but [1, 2, 2] is not a permutation (2 appears twice in the array) and [1, 3, 4] is also not a permutation (n = 3 but there is 4 in the array).

Your task is to find a permutation p of length n that there is no index i (1 ≤ i ≤ n) such that p_i = i (so, for all i from 1 to n the condition p_i ≠ i should be satisfied).

You have to answer t independent test cases.

If there are several answers, you can print any. It can be proven that the answer exists for each n > 1.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 100) — the number of test cases. Then t test cases follow.

The only line of the test case contains one integer n (2 ≤ n ≤ 100) — the length of the permutation you have to find.

Output

For each test case, print n distinct integers p_1, p_2, …, p_n — a permutation that there is no index i (1 ≤ i ≤ n) such that p_i = i (so, for all i from 1 to n the condition p_i ≠ i should be satisfied).

If there are several answers, you can print any. It can be proven that the answer exists for each n > 1.

Example

Input


2
2
5


Output


2 1
2 1 5 3 4

Solution (in JAVA):

Solution:
import java.util.*;
import java.util.Map.Entry;
import java.util.regex.Pattern;


import java.util.*;

import java.io.*;

public class Main {
	int left;
	int right;
	double divide;
	public Main(int a,int b,double divide){
		this.left=a;
		this.right=b;
		this.divide=divide;
	}
	static class FastReader  extends Thread{
		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 int power(int a,int b){
		 if(b==0){
			 return 1;
		 }
		 int temp=0;
		
		 if (b%2 == 0) {
			 temp=power(a,b/2);
		 return temp*temp;
		 } 
	     else{
		   temp=power(a,b/2);
		   return a*temp*temp;
		 
		 }

		 }
	 
	
	static int binary(int a[],int start,int end,int number){
		start=0;
		end=a.length-1;
		int mid=0;

		while(start<=end){
			mid=end+(end-start)/2;
			if(a[mid]==number){
				return mid;
			}
			else
			if(a[mid]<number){
               start=mid+1;
			}
			else
			end=mid-1;
		}
		return 0;
		
	}
 
 
	static void swap(int a[], int i, int j) {
		int temp = a[i];
		a[i] = a[j];
		a[j] = temp;
	}

	static void fill(int start, int end, int a[]) {
		for (int i = 0; i < end; ++i) {
			a[i] = scan.nextInt();
		}
	}
	static int bl[]=new int[100+1];
	static void PrimeFactorisation(){
	int max=1000;
	
	for(int i=4;i<=max;i+=2){
	 bl[i]=2;//Factor of the two
	
	}
	for(int i=3;i<=Math.sqrt(max);++i){
	if(bl[i]==i){
	for(int j=i*i;j<=max;j+=i){
	if(bl[j]==j){
	bl[j]=i;
	}
	
	}
	}
	}
	}
	static void factors(int x){
	while(x!=1){
	System.out.println(bl[x]);
	x=x/bl[x];
	
	}
	}
	
	
    static FastReader sc=new FastReader();
	static FastReader scan = new FastReader();
	private static boolean add;
	static long power(long a,long b){
		return (long)(Math.log(a)/Math.log(b));
	}
	static boolean isPowerOfTwo(long n,long m)
	{
		if(n==0)
		return false;
	 
	return (int)(Math.ceil((Math.log(n) / Math.log(m)))) == 
		   (int)(Math.floor(((Math.log(n) / Math.log(m)))));
	}
	/*H.entrySet().stream().sorted(HashMap.Entry.<Long,Long>comparingByValue().reversed()).forEach(e->{
		long k=e.getKey();
		System.out.print(k+" ");
		  });;-*/
		  
	 /*static long pow(long n){

             while(n>0){
				 n>>=1;

			 }
	 }*/
	 //counting total bits
	 static long countBits(long number) 
	 {  
		   
		 // log function in base 2  
		 // take only integer part 
		 return (long)(Math.log(number) /  
					  Math.log(2) + 1); 
				
	 }
	 static int gcd(int a,int b){
		 if(b==0){
			 return a; 
		 }
		 return gcd(a,b%a);
	 }
static void reverse(char a[],int start,int end){
	while(start<=end){
	 char temp=a[start];
	 a[start]=a[end];
	 a[end]=temp;
	 ++start;
	 --end;
	}
}

static void sieve(int a[],int n){
boolean bl[]=new boolean[4000001];
bl[0]=true;
bl[1]=true;
for (int i = 2; i < bl.length; i++) {
bl[i]=false;
}
for (int i = 2; i <=Math.sqrt(10000); i++) {
if(bl[i]==false){
for (int j = i*i ;j <=10000; j=j+i) {
 bl[j]=true;

}


}
 
}

}
static int check(String num){
	int n = num.length(); 
  
   
    int sum = 0; 
    for(int i = 0; i < n; i++) 
    sum += (int)(num.charAt(i)); 

    if (sum % 3 == 0) 
        return 0; 

    if (n == 1) 
        return -1; 
  
  
    for (int i = 0; i < n; i++) 
        if (sum % 3 == (num.charAt(i) - '0') % 3) 
            return 1; 
  
  
    if (n == 2) 
        return -1; 
  
  
    return 2; 

}
static int check(Queue<Integer>I,Queue<Integer>M,int power,String m){
	int count=0;
while(M.size()!=0&&I.size()!=0){
	int start=Math.min(I.peek(),M.peek());
	int end=Math.max(I.peek(),M.peek());
	//count the sheild in between
	int shield=0;
	for(int i=start;i<=end;++i){
 if(m.charAt(i)==':')++shield;

	}
	int first=I.peek();
	int second=M.peek();

if(power-Math.abs(first-second)-shield>0){
   ++count;
   M.remove();
   I.remove();
}else{
	if(I.peek()<M.peek()){
		I.remove();
	}
	else{
		M.remove();
	}

}

	

}
return count;
          

}
static int check(TreeSet<Character>T){
	 Iterator <Character>It=T.iterator();
   String ans="";
   while(It.hasNext()){
ans+=It.next();

   }
 return ans.compareTo("acef");
}
static Node root;
static class Node{
int data;
Node left;
Node right;
Node(int data){
	this.data=data;
	
}
}
//preorder Transversal using stack
static void printt(Node root) {
	if (root == null) {
		return;
	}
	Stack<Node> S = new Stack<>();
	S.add(root);
	System.out.print(root.data + " ");
	if (root.right != null) {
		S.add(root.right);
	}
	if (root.left != null) {
		S.add(root.left);
	}
	while (S.size() != 1) {
		Node peek = S.peek();
		S.pop();
		System.out.print(peek.data + " ");
		if (peek.right != null) {
			S.add(peek.right);
		}
		if (peek.left != null) {
			S.add(peek.left);
		}

	}
}
static void check(long a){
	if(a<0)
	a=-a;

}
static int check(int a,int b){
	if(b==0){
		return 1;
	}
	int temp=1;
	 if(b%2==0){
		  temp=check(a,b/2);
		 return temp*temp;
	 }
	 else{
		 temp=check(a,b/2);
        return  a*temp*temp;
	 }

}

static void printy(Node head){
	if(head==null){
		return ;
	}
	printy(head.left);
	System.out.println(head.data);
	printy(head.right);
}
//print the  path of the node
static ArrayList<Integer>A=new ArrayList<>();

static boolean printpath(Node head,int element){
	if(root==null){
		return false;
	}
	A.add(head.data);
	if(head.data==element){
		return true;
	}
	if(printpath(head.left,element)||printpath(head.right,element)){
		System.out.println(A);
   A.remove(A.size()-1);
  return true;
	
	}
	else{
	A.remove(A.size()-1);
	return false;
	}

}
static int check1(int n){
	int r=0;
	int sum=0;
	while(n!=0){
  r=n%10;
  sum+=r;
  n=n/10;

	}
	return sum;
}
static void print(Integer arr[]){
 for(int i=0;i<arr.length;++i){
	 System.out.print(arr[i]+" ");
 }}
 
public static void main(String[] args) throws NumberFormatException, IOException {
int t=scan.nextInt();
while(t-->0){
	int n=scan.nextInt();
	Integer ob[]=new Integer[n];
	for(int i=0;i<n;++i){
		ob[i]=i+1;
	}
	Arrays.sort(ob,Collections.reverseOrder());
	if(n%2==0){
 print(ob);
	}
	else{
   //swap 
   int temp=n/2+1;
   int tempq=ob[temp];
   ob[temp]=ob[temp-1];
   ob[temp-1]=tempq;
   print(ob);

	}
	System.out.println();
}


	
}}