#include <bits/stdc++.h>
using namespace std;
struct range {
  int l, r;
  range(int l, int r) : r(r), l(l) {}
};
struct cmp {
  bool operator()(range const& a, range const& b) {
    int la = a.r - a.l;
    int lb = b.r - b.l;
    if (la == lb) return a.l > b.l;
    return la < lb;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, i = 1, ind;
    cin >> n;
    int ans[n + 1];
    priority_queue<range, vector<range>, cmp> q;
    q.push(range(1, n));
    while (!q.empty()) {
      range cur = q.top();
      q.pop();
      ind = (cur.r + cur.l) / 2;
      ans[ind] = i++;
      if (cur.r > ind) {
        q.push(range(ind + 1, cur.r));
      }
      if (ind > cur.l) {
        q.push(range(cur.l, ind - 1));
      }
    }
    for (i = 1; i <= n; i++) cout << ans[i] << " ";
    cout << '\n';
  }
  return 0;
}
