#include <algorithm>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
using namespace std;

using ll = long long;

int main() {
   int t;
   scanf("%d", &t);
   while (t--) {
      int n;
      scanf("%d", &n);
      vector<int> a(n);
      for (int i = 0; i < n; i++) {
         a[i] = i;
      }
      for (int i = 0; i < n - 1; i += 2) {
         swap(a[i], a[i + 1]);
      }
      if (n % 2) {
         swap(a[n - 2], a[n - 1]);
      }
      for (int i = 0; i < n; i++) {
         printf("%d ", a[i] + 1);
      }
      printf("\n");
   }

   return 0;
}
