#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    priority_queue<pair<int, pair<int, int> > > pq;
    int n;
    cin >> n;
    int res[n + 2];
    int i = 1, l = 1, r = n, z = 0;
    int len = (r - l) + 1, mid;
    l *= -1, r *= -1;
    pq.push(make_pair(len, make_pair(l, r)));
    while (!pq.empty()) {
      l = -1 * pq.top().second.first;
      r = -1 * pq.top().second.second;
      len = pq.top().first;
      if (len % 2)
        mid = (r + l) / 2;
      else
        mid = (r + l - 1) / 2;
      res[mid] = i++;
      pq.pop();
      len = max(z, ((mid - 1) - l) + 1);
      if (len) pq.push(make_pair(len, make_pair((-1 * l), (-1 * (mid - 1)))));
      len = max(z, (r - (mid + 1)) + 1);
      if (len) pq.push(make_pair(len, make_pair((-1 * (mid + 1)), (-1 * r))));
    }
    for (int i = 1; i <= n; i++) cout << res[i] << " ";
    cout << endl;
  }
}
