#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    priority_queue<pair<int, pair<int, int>>> pq;
    pq.push(make_pair(n, make_pair(-1, -n)));
    int arr[n + 1];
    int i = 1;
    while (!pq.empty()) {
      pair<int, pair<int, int>> curr = pq.top();
      pq.pop();
      int left = (curr.second.first) * (-1);
      int right = (curr.second.second) * (-1);
      int mid = (left + right) / 2;
      arr[mid] = i;
      i++;
      if (left < mid)
        pq.push(make_pair(mid - left, make_pair(-left, -(mid - 1))));
      if (right > mid)
        pq.push(make_pair(right - mid, make_pair(-(mid + 1), -right)));
    }
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
