#include <bits/stdc++.h>
using namespace std;
long long frev(long long x, long long y) { return x > y; }
long long findset(long long a, long long ds[], long long rank[]) {
  if (a == ds[a]) return a;
  ds[a] = findset(ds[a], ds, rank);
  return ds[a];
}
long long dsu(long long a, long long b, long long ds[], long long rank[]) {
  long long repa = findset(a, ds, rank);
  long long repb = findset(b, ds, rank);
  if (rank[repa] == rank[repb]) {
    rank[repb]++;
    ds[repa] = repb;
  }
  if (rank[repa] > rank[repb]) {
    ds[repb] = repa;
  } else {
    ds[repa] = repb;
  }
  return 1;
}
long long gcd(long long a, long long b) {
  if (a > b) {
    long long t = a;
    a = b;
    b = t;
  }
  if (b % a == 0)
    return a;
  else
    return gcd(a, b % a);
}
int dfs(long long r, vector<long long> g[], long long vis[], long long siz[]) {
  vis[r] = 1;
  siz[r] = 1;
  for (auto l : g[r]) {
    if (!vis[l]) {
      siz[r] += dfs(l, g, vis, siz);
    }
  }
  return siz[r];
}
int main() {
  long long q;
  cin >> q;
  for (long long g = 0; g <= q - 1; g++) {
    long long n;
    cin >> n;
    long long a[n + 1];
    priority_queue<pair<long long, long long>> q;
    q.push({n, 1});
    long long nw = 1;
    while (!q.empty()) {
      pair<long long, long long> fr = q.top();
      q.pop();
      long long len = fr.first;
      long long st = fr.second;
      if (len == 1) {
        a[st] = nw;
        nw++;
      } else if (len % 2) {
        long long mid = st + len / 2;
        a[mid] = nw;
        nw++;
        q.push({len / 2, st});
        q.push({len / 2, mid + 1});
      } else {
        long long mid = st + len / 2;
        a[mid] = nw;
        nw++;
        q.push({len / 2, st});
        if (len / 2 - 1 > 0) q.push({len / 2 - 1, mid + 1});
      }
    }
    for (long long i = n; i >= 1; i--) cout << a[i] << " ";
    cout << endl;
  }
}
