#include <bits/stdc++.h>
using namespace std;
int a[200010], k = 0, n;
struct node {
  int l, r;
} b[200010];
bool cmp(node x, node y) {
  int t1 = x.r - x.l, t2 = y.r - y.l;
  if (t1 == t2)
    return x.l < y.l;
  else
    return t1 > t2;
}
void bfs(int l, int r) {
  struct node u;
  u.l = l;
  u.r = r;
  queue<node> q;
  q.push(u);
  while (!q.empty()) {
    struct node u = q.front();
    q.pop();
    int l = u.l, r = u.r;
    b[++k].l = l, b[k].r = r;
    if ((r - l + 1) & 1) {
      int x = (l + r) / 2;
      if (x - 1 >= l) {
        struct node v;
        v.l = l;
        v.r = x - 1;
        q.push(v);
      }
      if (r >= x + 1) {
        struct node v;
        v.l = x + 1;
        v.r = r;
        q.push(v);
      }
    } else {
      int x = (l + r - 1) / 2;
      if (x - 1 >= l) {
        struct node v;
        v.l = l;
        v.r = x - 1;
        q.push(v);
      }
      if (r >= x + 1) {
        struct node v;
        v.l = x + 1;
        v.r = r;
        q.push(v);
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    k = 0;
    for (int i = 1; i <= n; ++i) a[i] = 0;
    bfs(1, n);
    sort(b + 1, b + k + 1, cmp);
    for (int i = 1; i <= k; ++i) {
      int l = b[i].l, r = b[i].r;
      if ((r - l + 1) & 1) {
        int x = (l + r) / 2;
        a[x] = i;
      } else {
        int x = (l + r - 1) / 2;
        a[x] = i;
      }
    }
    for (int i = 1; i <= n; ++i) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
