#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e18;
const int N = 1e5 + 5;
struct data {
  int l, r, len;
  data(int l, int r, int len) : l(l), r(r), len(len) {}
  bool operator<(const data &q) const {
    return len == q.len ? l > q.l : len < q.len;
  }
};
void solve() {
  int n;
  cin >> n;
  priority_queue<data> q;
  q.push(data(1, n, n));
  int id = 1;
  vector<int> a(n + 1, 0);
  while (!q.empty()) {
    data t = q.top();
    q.pop();
    int l = t.l, r = t.r, len = t.len;
    if (len % 2 == 1) {
      int mid = (l + r) / 2;
      a[mid] = id++;
      if (len == 1) continue;
      q.push(data(l, mid - 1, mid - 1 - l + 1));
      q.push(data(mid + 1, r, r - mid - 1 + 1));
    } else {
      int mid = (l + r - 1) / 2;
      a[mid] = id++;
      if (len == 2) {
        q.push(data(mid + 1, r, r - mid - 1 + 1));
      } else {
        q.push(data(l, mid - 1, mid - 1 - l + 1));
        q.push(data(mid + 1, r, r - mid - 1 + 1));
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  for (int tc = 1; tc <= t; tc++) solve();
  return 0;
}
