#include <bits/stdc++.h>
using namespace std;
long long cnt;
void dnc(long long* arr, long long l, long long r) {
  if (l > r) {
    return;
  }
  cout << l << " " << r << endl;
  long long x = (l + r) >> 1;
  arr[x] = ++cnt;
  if (x - 1 - l >= r - x - 1) {
    dnc(arr, l, x - 1);
    dnc(arr, x + 1, r);
  } else {
    dnc(arr, x + 1, r);
    dnc(arr, l, x - 1);
  }
}
struct st {
  bool operator()(const pair<long long, long long>& p1,
                  const pair<long long, long long>& p2) {
    if (p1.first != p2.first) {
      return p1.first < p2.first;
    } else {
      return p1.second > p2.second;
    }
  }
};
bool findll(long long x, long long y, long long& len, long long& l) {
  if (x > y) {
    return false;
  }
  len = (y - x + 1);
  l = x;
  return true;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long arr[n];
    priority_queue<pair<long long, long long>,
                   vector<pair<long long, long long> >, st>
        pq;
    pq.push(make_pair(n, 0));
    long long cnt = 1;
    while (!pq.empty()) {
      pair<long long, long long> p = pq.top();
      long long x = p.second;
      long long y = p.second + p.first - 1;
      pq.pop();
      long long ind = (x + y) / 2;
      arr[ind] = cnt++;
      long long len1, l1;
      if (findll(x, ind - 1, len1, l1)) {
        pq.push(make_pair(len1, l1));
      }
      long long len2, l2;
      if (findll(ind + 1, y, len2, l2)) {
        pq.push(make_pair(len2, l2));
      }
    }
    for (long long i = 0; i < n; i++) cout << arr[i] << " ";
    cout << endl;
  }
  return 0;
}
