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