#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
struct segment {
  int l, r;
  bool operator<(const segment& other) const {
    if (r - l == other.r - other.l) {
      return l < other.l;
    }
    return r - l > other.r - other.l;
  }
};
void Solve() {
  int n;
  cin >> n;
  vector<int> ans(n, 0);
  set<segment> s;
  s.insert({0, n - 1});
  int iter = 1;
  while (!s.empty()) {
    auto top = *s.begin();
    s.erase(s.begin());
    int mid = (top.l + top.r) / 2;
    ans[mid] = iter;
    int newr = mid - 1;
    int newl = mid + 1;
    if (top.l <= newr) {
      s.insert({top.l, newr});
    }
    if (newl <= top.r) {
      s.insert({newl, top.r});
    }
    iter++;
  }
  for (const auto& elem : ans) {
    printf("%d ", elem);
  }
  printf("\n");
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    Solve();
  }
  return 0;
}
