#include <bits/stdc++.h>
using namespace std;
struct kek {
  int l, r;
  kek(int x = 0, int y = 0) { l = x, r = y; }
};
const bool operator<(const kek a, const kek b) {
  int aa = a.r - a.l, bb = b.r - b.l;
  if (aa != bb) {
    return aa > bb;
  }
  return a.l < b.l;
}
void solve() {
  int n;
  cin >> n;
  vector<int> ans(n);
  set<kek> setik;
  setik.insert(kek(0, n - 1));
  for (int i = 1; i <= n; ++i) {
    int l = setik.begin()->l, r = setik.begin()->r;
    setik.erase(setik.begin());
    int m = (l + r) / 2;
    ans[m] = i;
    setik.insert(kek(l, m - 1)), setik.insert(kek(m + 1, r));
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << ' ';
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
