#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long, long long> p1, pair<long long, long long> p2) {
  if (p1.first < p2.first) return true;
  if (p1.first > p2.first) return false;
  return p1.second >= p2.second;
}
bool cmp1(pair<long long, long long> p1, pair<long long, long long> p2) {
  if (p1.second > p2.second) return true;
  if (p1.second < p2.second) return false;
  return p1.first <= p2.first;
}
int32_t main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    set<array<long long, 3>> s;
    s.insert({-n, 0, n - 1});
    long long ct = 0;
    while (ct < n) {
      auto v = *(s.begin());
      s.erase(s.begin());
      long long l = v[1];
      long long r = v[2];
      long long mid = (l + r) / 2;
      a[mid] = ++ct;
      s.insert({-(mid - l), l, mid - 1});
      s.insert({-(r - mid), mid + 1, r});
    }
    for (long long i = 0; i < n; i++) cout << a[i] << " ";
    cout << "\n";
  }
}
