#include <bits/stdc++.h>
using namespace std;
const long long MAX = 2e3 + 10;
long long inf = (long long)1e13;
long long mod = (long long)998244353;
long long n, k;
int main() {
  ios::sync_with_stdio(0);
  long long q;
  cin >> q;
  while (q--) {
    set<pair<long long, long long>> nums;
    long long n;
    cin >> n;
    vector<long long> ans(n + 1);
    nums.insert({n, -1});
    for (int i = 0; i < n; i++) {
      pair<long long, long long> use;
      use = *(nums.rbegin());
      nums.erase(use);
      use.second = -use.second;
      long long l, r;
      l = use.second;
      r = l + use.first - 1;
      long long ind;
      if ((r - l + 1) % 2 == 1) {
        ind = (r + l) / 2;
      } else
        ind = (r + l - 1) / 2;
      if (ind - l != 0) nums.insert({ind - l, -l});
      if (ind != r) nums.insert({r - ind, -(ind + 1)});
      ans[ind] = i + 1;
    }
    for (int i = 1; i <= n; i++) {
      cout << ans[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
