#include <bits/stdc++.h>
using namespace std;
int s[500500];
struct node {
  int l;
  int r;
};
struct cmp1 {
  bool operator()(const node &x, const node &y) const {
    if (x.r - x.l != y.r - y.l) {
      return (x.r - x.l) < (y.r - y.l);
    } else {
      return x.r > y.r;
    }
  }
};
void solve() {
  priority_queue<node, vector<node>, cmp1> q;
  int n;
  cin >> n;
  int k = 1;
  q.push((node){1, n});
  while (!q.empty()) {
    node ss = q.top();
    q.pop();
    int n = ss.r - ss.l + 1;
    if (n % 2 == 0) {
      int m = (ss.l + ss.r - 1) / 2;
      s[m] = k++;
      if (m - 1 >= ss.l) q.push((node){ss.l, m - 1});
      if (m + 1 <= ss.r) q.push((node){m + 1, ss.r});
    } else {
      int m = (ss.l + ss.r) / 2;
      s[m] = k++;
      if (m - 1 >= ss.l) q.push((node){ss.l, m - 1});
      if (m + 1 <= ss.r) q.push((node){m + 1, ss.r});
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      printf("%d", s[i]);
    } else {
      printf(" %d", s[i]);
    }
  }
  printf("\n");
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
