#include <bits/stdc++.h>
using namespace std;
int a[200005], n;
pair<int, int> b[200005];
void f(int l, int r) {
  if (l > r) return;
  int m = (l + r) / 2;
  b[m] = {l - r, m};
  f(l, m - 1);
  f(m + 1, r);
}
void solve() {
  cin >> n;
  f(1, n);
  sort(b + 1, b + 1 + n);
  for (int i = 1; i <= n; i++) a[b[i].second] = i;
  for (int i = 1; i <= n; i++) cout << a[i] << " \n"[i == n];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  int tt;
  cin >> tt;
  while (tt--) solve();
}
