#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n);
    priority_queue<tuple<long long int, long long int, long long int>> q;
    q.push(make_tuple(n, 0, n - 1));
    long long int action = 1, mid, lSize, rSize, l, r, size;
    while (!q.empty()) {
      tie(size, l, r) = q.top();
      l = -l;
      q.pop();
      if (size == 1)
        v[l] = action;
      else if (size == 2) {
        v[l] = action;
        q.push(make_tuple(1, -r, r));
      } else {
        mid = (r + l) / 2;
        v[mid] = action;
        lSize = ((mid - 1) - l) + 1;
        rSize = (r - (mid + 1)) + 1;
        q.push(make_tuple(lSize, -l, mid - 1));
        q.push(make_tuple(rSize, -(mid + 1), r));
      }
      action++;
    }
    for (auto i : v) cout << i << ' ';
    cout << '\n';
  }
}
