#include<iostream>
#include <bits/stdc++.h>
#define fio 	   ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define vi 		   vector<int>
#define pii        pair<int,int>
#define mii        map<int,int>
#define int        long long
#define fi         first
#define se         second
#define mp         make_pair
#define pb         push_back
#define inf        1e18
#define ps(x,y)    fixed<<setprecision(y)<<x
using namespace std;
const int mod=1e9+7;
const int MAX=1e6;


void solve()
{
    fio;
    int n;
    cin>>n;
    if(n%2==0)
    {   
        for(int i=2;i<=n;i+=2)
        cout<<i<<" "<<i-1<<" ";
        cout<<endl;
        return;
    }   
    

    cout<<3<<" "<<1<<" "<<2<<" ";
    for(int i=5;i<=n;i+=2)
        cout<<i<<" "<<i-1<<" ";
        cout<<endl;

    return;
}


int32_t main(){
    fio;
    int t;
    cin>>t;
    while(t--)
    solve();
    return 0;
}