#include <iostream>
#include <list>
using namespace std;
int main(){
int m,n,tmp;
cin>>m;
while(m--){
list<int> l;
cin>>n;
for(int i = 1; i <= n; i++)
l.push_back(i);
while(!l.empty()){
for(int cnt = 2; cnt > 0 && l.size() > 1; cnt--){
tmp = l.front();
l.pop_front();
l.push_back(tmp);
}
cout<<l.front()<<" ";
l.pop_front();
}
cout<<endl;
}
}

京公网安备 11010502036488号