#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(pair<int, int> p1, pair<int, int> p2) {
    if (p1.first == p2.first)
      return p1.second > p2.second;
    else
      return p1.first < p2.first;
  }
};
int main() {
  int t, n, l, r, mid;
  cin >> t;
  while (t--) {
    cin >> n;
    vector<int> a(n);
    priority_queue<pair<int, int>, vector<pair<int, int>>, cmp> pq;
    pair<int, int> p;
    pq.push(make_pair(n, 0));
    int count = 1;
    while (!pq.empty()) {
      p = pq.top();
      pq.pop();
      if (p.first == 1) {
        a[p.second] = count;
        count++;
      } else {
        l = p.second;
        r = p.second + p.first - 1;
        mid = (l + r) / 2;
        a[mid] = count;
        count++;
        if (mid - l) pq.push(make_pair(mid - l, l));
        if (r - mid) pq.push(make_pair(r - mid, mid + 1));
      }
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
  }
}
