#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n];
    memset(arr, 0, sizeof(arr));
    priority_queue<pair<int, pair<int, int>>> pq;
    pq.push({n, {0, n - 1}});
    int t = 0;
    while (!pq.empty()) {
      int l = -1 * pq.top().second.first;
      int r = pq.top().second.second;
      int len = pq.top().first;
      pq.pop();
      if (l > r) {
        continue;
      } else {
        int mid = (l + r) / 2;
        t += 1;
        arr[mid] = t;
        pq.push({(len - 1) / 2, {-1 * l, mid - 1}});
        pq.push({len / 2, {-1 * (mid + 1), r}});
      }
    }
    for (int i = 0; i < n; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
