#include <bits/stdc++.h>
using namespace std;
void read(int& head) { scanf("%d", &head); }
class segment {
 public:
  int l, r;
  segment(int l_, int r_) {
    l = l_;
    r = r_;
  }
  bool operator<(segment seg2) const {
    if (r - l < seg2.r - seg2.l) return false;
    if (r - l == seg2.r - seg2.l and r > seg2.r) return false;
    return true;
  }
};
int arr[200005];
int main() {
  int t;
  read(t);
  while (t--) {
    int n;
    read(n);
    set<segment> segs;
    segs.insert(segment(1, n));
    int steps = 1;
    while (segs.size() > 0) {
      auto ptr = segs.begin();
      segment curr = *ptr;
      segs.erase(ptr);
      int mid = (curr.l + curr.r) / 2;
      arr[mid] = steps;
      steps++;
      if (curr.l <= mid - 1) segs.insert(segment(curr.l, mid - 1));
      if (mid + 1 <= curr.r) segs.insert(segment(mid + 1, curr.r));
    }
    for (int i = 1; i <= n; i++) {
      printf("%d ", arr[i]);
    }
    printf("\n");
  }
}
