//#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<cstdio>
#include<cstdlib>
using namespace std;
int main(){
	//freopen(" .in","r",stdin);
	//freopen(" .out","w",stdout);
	int t;
	scanf("%d",&t);
	while(t--){
		int n;
		scanf("%d",&n);
		if(n%2==1){
			printf("3 1 2 ");
			for(int i=4;i<=n;i+=2)printf("%d %d ",i+1,i);
		}
		else{
			for(int i=1;i<=n;i+=2)printf("%d %d ",i+1,i);
		}
		printf("\n");
	}
	//fclose(stdin);
	//fclose(stdout);
	return 0;
}

