#include <bits/stdc++.h>
using namespace std;
int t, n, a[200005];
priority_queue<pair<int, pair<int, int>>> q;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    int i = 0;
    q.push(make_pair(n, make_pair(n, n)));
    while (!q.empty()) {
      int l = n - q.top().second.first + 1, r = q.top().second.second, mid = 0;
      q.pop();
      if ((r - l + 1) % 2)
        mid = (l + r) / 2;
      else
        mid = (l + r - 1) / 2;
      a[mid] = ++i;
      if (l <= mid - 1)
        q.push(make_pair(mid - l, make_pair(n - l + 1, mid - 1)));
      if (r >= mid + 1) q.push(make_pair(r - mid, make_pair(n - mid, r)));
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
