#include <bits/stdc++.h>
using namespace std;
int a[210000];
int n;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    priority_queue<pair<int, int> > q;
    q.push({n - 1, -1});
    int x = 1;
    while (!q.empty()) {
      int l, r, d, e;
      d = q.top().first;
      e = q.top().second * -1;
      l = e;
      r = e + d;
      q.pop();
      if ((r - l + 1) % 2 == 1) {
        int y = (l + r) / 2;
        a[y] = x;
        x++;
        int sz;
        if (y - l >= r - y) {
          if (l <= y - 1) q.push({y - 1 - l, -l});
          if (y + 1 <= r) q.push({r - (y + 1), -(y + 1)});
        } else {
          if (y + 1 <= r) q.push({r - (y + 1), -(y + 1)});
          if (l <= y - 1) q.push({y - l - 1, -l});
        }
      } else {
        int y = (l + r - 1) / 2;
        a[y] = x;
        x++;
        if (y - l >= r - y) {
          if (l <= y - 1) q.push({y - 1 - l, -l});
          if (y + 1 <= r) q.push({r - (y + 1), -(y + 1)});
        } else {
          if (y + 1 <= r) q.push({r - (y + 1), -(y + 1)});
          if (l <= y - 1) q.push({y - l - 1, -l});
        }
      }
    }
    for (int i = 1; i < n + 1; i++) {
      printf("%d ", a[i]);
    }
    cout << endl;
  }
}
