水一波
#include <bits/stdc++.h>
using namespace std;
int q[60];
void solve() {
int hh = 0, tt = 0, id = 0, x, n;
cin >> n;
for(int i = 1; i <= n; i++) q[tt++] = i;
while(hh != tt) {
int a = q[hh++];
if(hh == 60) hh = 0;
if(++id % 3) {
q[tt++] = a;
if(tt == 60) tt = 0;
}
else cout << a << " ";
}
cout << "\n";
}
int main() {
int t; cin >> t;
while(t --) {
solve();
}
return 0;
}