#include <bits/stdc++.h>
using namespace std;
int t, n;
struct Cmp {
  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;
  }
};
priority_queue<pair<int, int>, vector<pair<int, int> >, Cmp> pq;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    int cnt = 1;
    vector<int> arr(n + 1);
    pq.push(make_pair(1, n));
    while (!pq.empty()) {
      pair<int, int> p = pq.top();
      pq.pop();
      int mid = (p.first + p.second) >> 1;
      arr[mid] = cnt++;
      if (p.first < mid) {
        pq.push(make_pair(p.first, mid - 1));
      }
      if (p.second > mid) {
        pq.push(make_pair(mid + 1, p.second));
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    cout << '\n';
  }
  return 0;
}
