#include <bits/stdc++.h>
using namespace std;
struct option {
  bool operator()(const pair<int, pair<int, int>>& a,
                  const pair<int, pair<int, int>>& b) const {
    return a.first < b.first ||
           a.first == b.first && a.second.first > b.second.first;
  }
};
int main() {
  int T;
  cin >> T;
  while (T) {
    T--;
    int n;
    cin >> n;
    vector<int> ans(n);
    priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>,
                   option>
        a;
    a.push({n, {0, n - 1}});
    int i = 1;
    while (a.size() > 0) {
      int q = a.top().second.first;
      int p = a.top().second.second;
      int temp;
      a.pop();
      if (p < q || p < 0) continue;
      if ((p + q) % 2 == 0) {
        temp = (p + q) / 2;
        ans[temp] = i;
      } else {
        temp = (p + q - 1) / 2;
        ans[temp] = i;
      }
      a.push({temp - q, {q, temp - 1}});
      a.push({p - temp, {temp + 1, p}});
      i++;
    }
    for (int i = 0; i < ans.size(); i++) {
      cout << ans[i] << " ";
    }
    cout << endl;
  }
}
