#include <bits/stdc++.h>
using namespace std;
set<pair<int, pair<int, int> > > s;
set<pair<int, pair<int, int> > >::iterator it;
int a[200005];
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    s.insert({n, {1, n}});
    int c = 1;
    while (!s.empty()) {
      it = --s.end();
      int size_ = it->first;
      it = s.lower_bound({size_, {0, 0}});
      int x = it->second.first;
      int y = it->second.second;
      int z;
      if ((y - x + 1) % 2 == 0)
        z = (x + y - 1) / 2;
      else
        z = (x + y) / 2;
      a[z] = c;
      int l = z - 1;
      int r = z + 1;
      s.erase(it);
      if (l >= x) s.insert({l - x + 1, {x, l}});
      if (r <= y) s.insert({y - r + 1, {r, y}});
      c++;
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
    s.clear();
  }
}
