#include <bits/stdc++.h>
using namespace std;
int T;
int n;
const int N = 2e5 + 5;
int a[N];
struct node {
  int len, l, r, mid;
  inline bool operator<(const node &x) const {
    return x.len > len || x.len == len && x.mid < mid;
  }
};
priority_queue<node> q;
int main() {
  scanf("%d", &T);
  while (T--) {
    int tot = 0;
    scanf("%d", &n);
    q.push((node){1 + n - 1, 1, n, (1 + n) / 2});
    while (q.size()) {
      tot++;
      node u = q.top();
      q.pop();
      a[u.mid] = tot;
      node v;
      v.l = u.l;
      v.r = u.mid - 1;
      v.len = v.r - v.l + 1;
      v.mid = (v.l + v.r) / 2;
      if (v.len) q.push(v);
      v.l = u.mid + 1;
      v.r = u.r;
      v.len = v.r - v.l + 1;
      v.mid = (v.l + v.r) / 2;
      if (v.len) q.push(v);
    }
    for (register int i = 1; i <= n; ++i) printf("%d ", a[i]);
    puts("");
  }
  return 0;
}
