#include <bits/stdc++.h>
using namespace std;
struct Node {
  int l;
  int r;
};
bool operator<(const Node& x, const Node& y) {
  if (x.r - x.l == y.r - y.l) return x.l < y.l;
  return x.r - x.l > y.r - y.l;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> arr(n + 1);
    set<Node> pq;
    pq.insert({1, n});
    int itr = 1;
    while (!pq.empty()) {
      Node node = *pq.begin();
      pq.erase(pq.begin());
      int l = node.l;
      int r = node.r;
      if ((r - l + 1) % 2 == 1) {
        int m = (l + r) / 2;
        arr[m] = itr;
        if (l <= m - 1) pq.insert({l, m - 1});
        if (m + 1 <= r) pq.insert({m + 1, r});
      } else {
        int m = (l + r - 1) / 2;
        arr[m] = itr;
        if (l <= m - 1) pq.insert({l, m - 1});
        if (m + 1 <= r) pq.insert({m + 1, r});
      }
      itr++;
    }
    for (int i = 1; i <= n; i++) cout << arr[i] << " ";
    cout << '\n';
  }
  return 0;
}
