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