#include <bits/stdc++.h>
using namespace std;
const int MAX = (int)2e5 + 10;
const int INF = (int)1e9 + 99;
struct info {
  int l, r, zero;
};
bool operator<(info a, info b) {
  if (a.zero == b.zero) return a.l > b.l;
  return a.zero < b.zero;
}
int main(int argc, char** argv) {
  int n, t;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    int ar[n + 1];
    priority_queue<info> pq;
    pq.push({1, n, n});
    for (int i = 1; i <= n; ++i) {
      int l = pq.top().l;
      int r = pq.top().r;
      int z = pq.top().zero;
      pq.pop();
      int pos = (l + r - 1 + (r - l + 1) % 2) / 2;
      ar[pos] = i;
      if (l < pos) pq.push({l, pos - 1, pos - l});
      if (pos < r) pq.push({pos + 1, r, r - pos});
    }
    for (int i = 1; i <= n; ++i) {
      if (i > 1) putchar(' ');
      printf("%d", ar[i]);
    }
    puts("");
  }
  return 0;
}
