#include #include #include #include #include #include #include #include #include using namespace std; const int MAXN = 100000; void solve() { int n; assert(scanf("%d", &n) == 1 && 1 <= n && n <= MAXN); if (n & 1) { for (int i = 0; i < n - 3; ++ i) { printf("%d ", (i ^ 1) + 1); } printf("%d %d %d\n", n - 1, n, n - 2); } else { for (int i = 0; i < n; ++ i) { printf("%d ", (i ^ 1) + 1); } puts(""); } } int main() { int tests; for (assert(scanf("%d", &tests) == 1 && 1 <= tests && tests <= 10); tests --; ) { solve(); } return 0; }