#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int ans[maxn];
struct node {
  int l, r;
  bool operator<(const node& a) const {
    int s1 = r - l + 1;
    int s2 = a.r - a.l + 1;
    if (s1 == s2)
      return a.l < l;
    else
      return a.r - a.l + 1 > r - l + 1;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int tot = 0;
    priority_queue<node> q;
    q.push({1, n});
    while (!q.empty()) {
      node u = q.top();
      q.pop();
      int mid = (u.l + u.r) / 2;
      ans[mid] = ++tot;
      if (mid + 1 <= u.r) {
        q.push({mid + 1, u.r});
      }
      if (mid - 1 >= u.l) {
        q.push({u.l, mid - 1});
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << ans[i] << " ";
    }
    cout << '\n';
  }
}
