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