#include <bits/stdc++.h>
using namespace std;
long long int powe(long long int a, long long int b) {
  long long int ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = ans * a;
    a = a * a;
  }
  return ans;
}
class Comp {
 public:
  bool operator()(pair<long long int, long long int> a,
                  pair<long long int, long long int> b) {
    if (a.first < b.first || (a.first == b.first && a.second > b.second)) {
      return true;
    }
    return false;
  }
};
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n, 0);
  priority_queue<pair<long long int, long long int>,
                 vector<pair<long long int, long long int>>, Comp>
      vp;
  vp.push({n, 0});
  long long int ind = 0, indd = n - 1;
  long long int mid, cur = 1;
  while (!vp.empty()) {
    pair<long long int, long long int> p = vp.top();
    vp.pop();
    ind = p.second;
    indd = ind + p.first - 1;
    long long int len = indd - ind + 1;
    long long int pp = indd - ind + 1;
    if (pp & 1)
      mid = (ind + indd) / 2;
    else {
      mid = (ind + indd - 1) / 2;
    }
    a[mid] = cur++;
    if ((indd - mid) > 0) vp.push({(indd - mid), mid + 1});
    if (mid - ind > 0) {
      vp.push({(mid - ind), ind});
    }
  }
  for (long long int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
