#include <bits/stdc++.h>
using namespace std; 
#define lli long long int
const lli MOD=1e9+7;
#define ff first
#define ss second
#define TIME cerr<<"Time Taken:"<<(float)clock()/CLOCKS_PER_SEC*1000<<"ms"<<endl

lli arr[105];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    lli t,n,i;
    cin >> t;
    while(t--){
        cin >> n;
        for(i=1;i<=n;i++){
            if(i % 2 == 0)
                arr[i] = i-1;
            else
                arr[i] = i+1;
        }
        if(n % 2 != 0)
        {
            arr[n] = n-2;
            arr[n-1] = n;
        }
        for(i=1;i<=n;i++)
            cout << arr[i] << " ";
        cout << endl;
    }   
    TIME;
    return 0;
}