#include <bits/stdc++.h>
using namespace std;
struct Range {
  int L, R;
  Range(int l, int r) : L(l), R(r) {}
};
struct Comp {
  bool operator()(Range const& a, Range const& b) {
    if ((a.R - a.L + 1) == (b.R - b.L + 1)) return a.L > b.L;
    return (a.R - a.L + 1) < (b.R - b.L + 1);
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> Ans(n + 1);
    Ans.assign(n + 1, 0);
    priority_queue<Range, vector<Range>, Comp> Q;
    Q.push(Range(1, n));
    int val = 1;
    while (!Q.empty()) {
      Range a(0, 0);
      a = Q.top();
      Q.pop();
      int mid, L = a.L, R = a.R;
      if ((R - L + 1) % 2 == 0)
        mid = (L + R - 1) / 2;
      else
        mid = (L + R) / 2;
      Ans[mid] = val;
      if (L <= mid - 1) Q.push(Range(L, mid - 1));
      if (mid + 1 <= R) Q.push(Range(mid + 1, R));
      val += 1;
    }
    for (int i = 1; i <= n; i++) cout << Ans[i] << " ";
    cout << endl;
  }
}
