#include <iostream>
using namespace std;

int main()
{
    int t;
    cin >> t;

    while (t--)
    {
        int n;
        cin >> n;

        int t = 2 + n%2;

        if (n % 2)
        {
            cout << "3 1 2 ";

        }else
           cout << "2 1 ";

           int i;

           for (i = t + 1 ;i < n;i += 2)
           {
               cout << i + 1 << " " << i << " ";
           }

           cout << "\n";
    }
}
