#include <bits/stdc++.h>
using namespace std;
struct comp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) const {
    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>, comp> s;
    vector<int> a(n + 1);
    s.insert({0, n - 1});
    int i = 1;
    while (not s.empty()) {
      pair<int, int> cur = *s.begin();
      int j = (cur.first + cur.second) / 2;
      a[j] = i;
      i++;
      s.erase(s.begin());
      if (j - 1 >= cur.first) {
        s.insert({cur.first, j - 1});
      }
      if (j + 1 <= cur.second) {
        s.insert({j + 1, cur.second});
      }
    }
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
}
