#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) const {
    int la = a.second - a.first;
    int lb = b.second - b.first;
    if (la == lb)
      return a.first < b.first;
    else
      return la > lb;
  }
};
void solve() {
  int n;
  cin >> n;
  set<pair<int, int>, cmp> segs;
  segs.insert({0, n - 1});
  vector<int> a(n);
  for (int i = 1; i <= n; ++i) {
    pair<int, int> cur = *segs.begin();
    segs.erase(segs.begin());
    int id = (cur.first + cur.second) / 2;
    a[id] = i;
    if (cur.first < id) segs.insert({cur.first, id - 1});
    if (id < cur.second) segs.insert({id + 1, cur.second});
  }
  for (auto it : a) cout << it << " ";
  cout << "\n";
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
