#include <bits/stdc++.h>
using namespace std;
bool compare(vector<int>& a, vector<int>& b) {
  if (a[1] - a[0] == b[1] - b[0]) return a[0] >= b[0];
  return a[1] - a[0] <= b[1] - b[0];
}
int main() {
  int T;
  cin >> T;
  for (int qq = 1; qq <= T; qq++) {
    int n;
    cin >> n;
    vector<int> a(n, 0);
    vector<vector<int>> q;
    q.push_back({0, n - 1});
    for (int i = 1; i <= n; i++) {
      pop_heap(q.begin(), q.end(), compare);
      vector<int> tmp = q.back();
      q.pop_back();
      int l = tmp[0];
      int r = tmp[1];
      int v = r - l + 1;
      int m = 0;
      if (v % 2 == 1) {
        m = (l + r) / 2;
      } else {
        m = (l + r - 1) / 2;
      }
      a[m] = i;
      q.push_back({l, m - 1});
      push_heap(q.begin(), q.end(), compare);
      q.push_back({m + 1, r});
      push_heap(q.begin(), q.end(), compare);
    }
    for (int i = 0; i < a.size(); i++) {
      cout << a[i] << ' ';
    }
    cout << endl;
  }
  return 0;
}
