#include <bits/stdc++.h>
using namespace std;
struct Compare {
  bool operator()(pair<int, pair<int, int>> p1, pair<int, pair<int, int>> p2) {
    if (p1.first == p2.first)
      return p1.second.first > p2.second.first;
    else
      return p1.first < p2.first;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int, int>>>,
                   Compare>
        q;
    vector<int> v(n, 0);
    int i = 1;
    q.push({n, {0, n - 1}});
    while (!q.empty()) {
      pair<int, pair<int, int>> p = q.top();
      q.pop();
      int mid = (p.second.first + p.second.second) / 2;
      v[mid] = i;
      i++;
      if (p.second.first <= mid - 1) {
        q.push({mid - p.second.first, {p.second.first, mid - 1}});
      }
      if (p.second.second >= mid + 1) {
        q.push({p.second.second - mid, {mid + 1, p.second.second}});
      }
    }
    for (int i = 0; i < n; i++) {
      cout << v[i] << " ";
    }
    cout << "\n";
  }
}
