#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    vector<long long int> v(n, 0);
    priority_queue<pair<long long int, pair<long long int, long long int>>> pq;
    pq.push({n, {0, n - 1}});
    long long int count = 0;
    while (!pq.empty()) {
      long long int l = -1 * pq.top().second.first;
      long long int r = pq.top().second.second;
      long long int length = pq.top().first;
      pq.pop();
      if (l > r) {
        continue;
      }
      count++;
      long long int mid = (l + r) / 2;
      v[mid] = count;
      pq.push({mid - l + 1, {(-1 * l), mid - 1}});
      pq.push({r - mid + 1, {-1 * (mid + 1), r}});
    }
    for (auto it : v) {
      cout << it << " ";
    }
    cout << endl;
  }
}
