#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const pair<long long, pair<long long, long long>> &p1,
                  const pair<long long, pair<long long, long long>> &p2) {
    if (p1.first == p2.first) {
      return (p1.second.first > p2.second.first);
    }
    return p1.first < p2.first;
    return true;
  }
};
signed main() {
  std ::ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    set<pair<long long, pair<long long, long long>>, cmp> segs;
    segs.insert({n + 1, {1, n}});
    vector<long long> answer(n + 1);
    long long ind = 0;
    while (ind != n) {
      auto p = segs.rbegin();
      auto pp = *p;
      long long len = pp.first;
      long long l = pp.second.first, r = pp.second.second;
      long long mid = (l + r) / 2;
      answer[mid] = ++ind;
      segs.erase(prev(segs.end()));
      long long len1 = mid - l;
      long long len2 = r - (mid + 1) + 1;
      segs.insert({len1, {l, mid - 1}});
      segs.insert({len2, {mid + 1, r}});
    }
    for (long long i = 1; i <= n; i++) cout << answer[i] << ' ';
    cout << '\n';
  }
}
