#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
struct seg {
  int s, t;
};
bool operator<(seg a, seg b) {
  if (a.t - a.s == b.t - b.s)
    return a.s > b.s;
  else
    return a.t - a.s < b.t - b.s;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a[MAXN];
    int n;
    cin >> n;
    priority_queue<seg> que;
    que.push({1, n});
    int num = 0;
    while (!que.empty()) {
      seg p = que.top();
      que.pop();
      int mid = (p.s + p.t) >> 1;
      a[mid] = ++num;
      if (mid - 1 >= p.s) que.push({p.s, mid - 1});
      if (mid + 1 <= p.t) que.push({mid + 1, p.t});
    }
    for (int i = 1; i <= n; ++i) cout << a[i] << ' ';
    cout << endl;
  }
  return 0;
}
