#include <bits/stdc++.h> // All praise is due to Allah alone, and peace and blessings be
using namespace std; // upon him, after whom there is no other Prophet.
int32_t main() {
cin.tie(0)->sync_with_stdio(false);
function<void()> Test_Case = [&]() {
int n; cin >> n;
int ar[n];
iota(ar, ar + n, 1);
for(int i = 0; i < n - 1; i += 2) {
swap(ar[i], ar[i + 1]);
}
if(n & 1) swap(ar[n - 2], ar[n - 1]);
for(int i : ar) cout << i << ' '; cout << '\n';
};
int32_t Case = 1; cin >> Case;
for (int T = 1; T <= Case; T++) {
Test_Case();
}
return 0;
}