#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
struct cmp {
  bool operator()(const pair<long long, pair<long long, long long>> &a,
                  const pair<long long, pair<long long, long long>> &b) const {
    if (a.first != b.first)
      return a.first > b.first;
    else {
      return a.second.first < b.second.first;
    }
  }
};
void solver(long long n) {
  vector<long long> ans(n + 1, 0);
  set<pair<long long, pair<long long, long long>>, cmp> d;
  d.insert({n, {0, n - 1}});
  long long ctr = 1;
  while (d.size() != 0) {
    pair<long long, pair<long long, long long>> pp = *d.begin();
    d.erase(d.begin());
    if (pp.second.first < 0 || pp.second.second < 0 ||
        pp.second.first > pp.second.second)
      continue;
    long long mid = (pp.second.first + pp.second.second) / 2;
    ans[mid] = ctr++;
    d.insert(make_pair((mid - 1) - pp.second.first,
                       make_pair(pp.second.first, mid - 1)));
    d.insert(make_pair(pp.second.second - (mid + 1),
                       make_pair(mid + 1, pp.second.second)));
  }
  for (long long i = 0; i < n; i++) cout << ans[i] << " ";
  cout << "\n";
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long tc;
  cin >> tc;
  while (tc--) {
    long long n;
    cin >> n;
    if (n == 1) {
      cout << 1 << "\n";
      continue;
    } else {
      solver(n);
    }
  }
  return 0;
}
