#include <bits/stdc++.h>
using namespace std;
priority_queue<pair<long, long> > line;
long a[600000];
void process() {
  long i, n, k, p, left, right, length;
  cin >> n;
  line.push(make_pair(n, -1));
  long dem = 0;
  while (line.empty() == false) {
    dem++;
    pair<long, long> x = line.top();
    line.pop();
    length = x.first;
    left = -x.second;
    right = left + length - 1;
    long mid = (left + right) / 2;
    a[mid] = dem;
    if (mid - 1 >= left) line.push(make_pair(mid - left, -left));
    if (right >= mid + 1) line.push(make_pair(right - mid, -(mid + 1)));
  }
  for (i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
}
int main(int argc, char const *argv[]) {
  long i, t;
  cin >> t;
  for (i = 1; i <= t; i++) process();
  return 0;
}
