#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 * 1e6 + 4;
char s[maxn];
int a[maxn];
struct pos {
  int l, r;
  bool operator<(const pos& p) const {
    int len = r - l, len1 = p.r - p.l;
    if (len > len1) return 0;
    if (len1 > len) return 1;
    if (l < p.l) return 0;
    return 1;
  }
};
priority_queue<pos> q;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) a[i] = 0;
    q.push({1, n});
    for (int i = 1; i <= n; ++i) {
      pos tmp = q.top();
      q.pop();
      int l = tmp.l;
      int r = tmp.r;
      int mid = l + r >> 1;
      a[mid] = i;
      if (r > mid) q.push({mid + 1, r});
      if (mid > l) q.push({l, mid - 1});
    }
    for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
    puts("");
    while (!q.empty()) q.pop();
  }
  return 0;
}
