#include <bits/stdc++.h>
using namespace std;
struct node {
  int l;
  int r;
  int len;
  bool operator<(const node& others) const {
    if (len == others.len)
      return l > others.l;
    else
      return len < others.len;
  }
};
int ar[200010];
int main() {
  int num;
  cin >> num;
  while (num--) {
    int n;
    cin >> n;
    priority_queue<node> q;
    q.push((node){1, n, n});
    for (int i = 1; i <= n; i++) {
      node temp = q.top();
      q.pop();
      int pos =
          temp.len % 2 ? (temp.l + temp.r) / 2 : (temp.l + temp.r - 1) / 2;
      ar[pos] = i;
      if (pos - temp.l >= 1) q.push((node){temp.l, pos - 1, pos - temp.l});
      if (temp.r - pos >= 1) q.push((node){pos + 1, temp.r, temp.r - pos});
    }
    cout << ar[1];
    for (int i = 2; i <= n; i++) cout << " " << ar[i];
    cout << endl;
  }
}
