#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(const pair<int, int>& lhs, const pair<int, int>& rhs) {
    if (rhs.first == lhs.first) return rhs.second < lhs.second;
    return rhs.first > lhs.first;
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    priority_queue<pair<int, int>, vector<pair<int, int>>, comp> q;
    q.push(make_pair(n, 0));
    int curr = 1;
    while (q.size() > 0) {
      auto top = q.top();
      q.pop();
      int mid = (2 * top.second + top.first - 1) / 2;
      a[mid] = curr++;
      pair<int, int> seg1(mid - top.second, top.second);
      if (seg1.first > 0) q.push(seg1);
      pair<int, int> seg2(top.first - seg1.first - 1, mid + 1);
      if (seg2.first > 0) q.push(seg2);
    }
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
