#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, nb = 1;
    cin >> n;
    priority_queue<pair<int, int> > pq;
    pq.push(make_pair(n, -1));
    int a[n + 1];
    while (!pq.empty()) {
      int s = pq.top().second * (-1);
      int l = pq.top().first;
      pq.pop();
      if (l % 2) {
        a[s + l / 2] = nb;
        if (l / 2) {
          pq.push(make_pair(l / 2, (-1) * s));
          pq.push(make_pair(l / 2, (-1) * (s + l / 2 + 1)));
        }
      } else {
        a[s + l / 2 - 1] = nb;
        pq.push(make_pair(l / 2, (-1) * (s + l / 2)));
        if (l > 2) pq.push(make_pair(l / 2 - 1, (-1) * (s)));
      }
      nb++;
    }
    for (int i = 1; i <= n; i++) cout << a[i] << ' ';
    cout << '\n';
  }
}
