#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(pair<int, int> v1, pair<int, int> v2) const {
    int l1 = v1.second - v1.first + 1;
    int l2 = v2.second - v2.first + 1;
    if (l1 == l2)
      return v1.first < v2.first;
    else
      return l1 > l2;
  }
};
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    set<pair<int, int>, cmp> v;
    vector<int> a(n);
    v.insert({0, n - 1});
    for (int i = 1; i <= n; i++) {
      auto x = *v.begin();
      int j = (x.first + x.second) / 2;
      a[j] = i;
      v.erase(v.begin());
      if (j > x.first) v.insert({x.first, j - 1});
      if (j < x.second) v.insert({j + 1, x.second});
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
