#include <bits/stdc++.h>
using namespace std;
int a[300000] = {0};
static int num;
class compare {
 public:
  bool operator()(pair<int, int> a, pair<int, int> b) {
    if (a.second - a.first != b.second - b.first)
      return a.second - a.first < b.second - b.first;
    return a.first > b.first;
  }
};
int main() {
  int t;
  cin >> t;
  while (t--) {
    num = 1;
    int n;
    cin >> n;
    for (int i = 0; i <= n; i++) a[i] = 0;
    priority_queue<pair<int, int>, vector<pair<int, int> >, compare> pq;
    pq.push(make_pair(1, n));
    while (!pq.empty()) {
      pair<int, int> p = pq.top();
      pq.pop();
      int s = p.first, e = p.second;
      if ((e - s + 1) & 1 == 1) {
        int in = (s + e) / 2;
        a[in] = num++;
        if (in - 1 >= s) pq.push(make_pair(s, in - 1));
        if (e >= in + 1) pq.push(make_pair(in + 1, e));
      } else {
        int in = (s + e - 1) / 2;
        a[in] = num++;
        if (in - 1 >= s) pq.push(make_pair(s, in - 1));
        if (e >= in + 1) pq.push(make_pair(in + 1, e));
      }
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
  }
}
