#include<string>
#include<vector>
#include<cmath>
#include<iomanip>
#include<algorithm>
#include<iostream>
#include<stack>
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
    IOS
    int n,a;
    cin>>n;
    while(n--)
    {
        cin>>a;
        for(int i=2;i<=a;i+=2)
        {
        cout<<i<<' ';
        if(a%2&&i==a-1)
        cout<<a--<<' ';
        cout<<i-1<<' ';
        }
        cout<<endl;
    }
    return 0;
}