#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) const {
    int len1 = a.second - a.first + 1;
    int len2 = b.second - b.first + 1;
    if (len1 == len2) return a.first < b.first;
    return len1 > len2;
  }
};
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, mid;
    cin >> n;
    vector<long long> v(n + 1, 0);
    set<pair<int, int>, cmp> maxSeg;
    maxSeg.insert(make_pair(1, n));
    for (int i = 1; i < n + 1; i++) {
      pair<int, int> curr = *maxSeg.begin();
      mid = (curr.first + curr.second) / 2;
      maxSeg.erase(maxSeg.begin());
      v[mid] = i;
      if (mid > curr.first) maxSeg.insert(make_pair(curr.first, mid - 1));
      if (mid < curr.second) maxSeg.insert(make_pair(mid + 1, curr.second));
    }
    for (auto it : v)
      if (it > 0) cout << it << " ";
    cout << endl;
  }
}
