def arrayBuilder(n):
list = []
for i in range(2 * n):
list.append(i + 1)
for k in range(n // 2):
list[n + 2 * k] = 2 + 2 * k
for j in range(n - 1):
list[j + 1] = list[j + n] - 1
list[0] = 2 * n - 1
output = ""
for num in list:
output += str(num) + " "
if (num == n - 1):
output += "\n"
print(output)
testCases = int(input())
for q in range(testCases):
u = int(input())
if u%2 == 0:
arrayBuilder(u)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll,ll>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vpll = vector<pll>;
#define tcT template<class T
#define tcTU tcT, class U
#define pb push_back
#define fi first
#define se second
#define all(x) begin(x), end(x)
// loops
#define FOR(i,a,b) for (ll i = (a); i < (b); ++i)
#define ROF(i,a,b) for (ll i = (b)-1; i >= (a); --i)
#define trav(a,x) for (auto& a: x)
//min heap
template<class T> using pqg = priority_queue<T,vector<T>,greater<T>>;
const ll MOD = 1e9+7; // 998244353;
const ll MX = 2e5+5;
const ll INF = 1e18; // not too close to LLONG_MAX
const ld PI = acos((ld)-1);
const ll dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1}; // for every grid problem!!
map<pll,char> dirFromDiff = {{{1,0},'R'},{{0,1},'U'},{{-1,0},'L'} , {{0,-1},'D'}};
map<char,pll> diffFromDir = {{'R',{1,0}} , {'U',{0,1}}, {'L',{-1,0}},{'D',{0,-1}}};
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T>
using oset = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
tcTU> T fstTrue(T lo, T hi, U f) {hi ++; assert(lo <= hi); while (lo < hi) {T mid = lo+(hi-lo)/2;
f(mid) ? hi = mid : lo = mid+1; } return lo;}
tcTU> T lstTrue(T lo, T hi, U f){lo --; assert(lo <= hi);while (lo < hi) {T mid = lo+(hi-lo+1)/2;
f(mid) ? lo = mid : hi = mid-1;} return lo;}
ll binpow(ll x,ll n){if(n==0)return 1;ll temp = binpow(x,n/2);temp =(temp*temp)%MOD;
if(n&1) {temp = (temp*x)%MOD;}return temp;}
void solve(){
ll n; cin>>n;
ll maxi = 2*n, mini = 2;
vector<vll> ans(2,vll(n));
FOR(j,0,n){
if(j%2==0){
ans[0][j] = maxi;
maxi -=2;
}
if(j%2==1){
ans[0][j] = mini;
mini+=2;
}
}
maxi = 2*n-1;
mini = n-1;
for(ll j = n-1;j>=0;--j){
if(j%2==1){
ans[1][j] = maxi;
maxi -=2;
}
if(j%2==0){
ans[1][j] = mini;
mini-=2;
}
}
FOR(i,0,2){
FOR(j,0,n){
cout<<ans[i][j]<<" ";
}
cout<<"\n";
}
}
int main(){
cin.sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll t=1;
cin>>t;
FOR(i,0,t){
solve();
}
}
1B - Spreadsheet | 1177A - Digits Sequence (Easy Edition) |
1579A - Casimir's String Solitaire | 287B - Pipeline |
510A - Fox And Snake | 1520B - Ordinary Numbers |
1624A - Plus One on the Subset | 350A - TL |
1487A - Arena | 1520D - Same Differences |
376A - Lever | 1305A - Kuroni and the Gifts |
1609A - Divide and Multiply | 149B - Martian Clock |
205A - Little Elephant and Rozdil | 1609B - William the Vigilant |
978B - File Name | 1426B - Symmetric Matrix |
732B - Cormen --- The Best Friend Of a Man | 1369A - FashionabLee |
1474B - Different Divisors | 1632B - Roof Construction |
388A - Fox and Box Accumulation | 451A - Game With Sticks |
768A - Oath of the Night's Watch | 156C - Cipher |
545D - Queue | 459B - Pashmak and Flowers |
1538A - Stone Game | 1454C - Sequence Transformation |