#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int kk[n + 1];
    int l, r;
    pair<int, int> pp;
    priority_queue<pair<int, int>> pq;
    pq.push(make_pair(n, -1));
    for (int i = 1; i <= n; i++) {
      pp = pq.top();
      l = -pp.second;
      r = l + pp.first - 1;
      if ((r - l + 1) % 2 == 1) {
        kk[(l + r) / 2] = i;
        pq.push(make_pair((r - l + 1) / 2, -l));
        pq.push(make_pair((r - l + 1) / 2, -((l + r) / 2 + 1)));
      } else {
        kk[(l + r - 1) / 2] = i;
        pq.push(make_pair((r - l + 1) / 2 - 1, -l));
        pq.push(make_pair((r - l + 1) / 2, -((l + r - 1) / 2 + 1)));
      }
      pq.pop();
    }
    for (int i = 1; i <= n; i++) {
      cout << kk[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
