#include <bits/stdc++.h>
using namespace std;
int ans[200005];
int cont;
void solve() {
  int n;
  cin >> n;
  cont = 0;
  memset(ans, 0, sizeof ans);
  priority_queue<pair<int, int>> p;
  p.push({n, -1});
  while (p.size()) {
    if (cont > n) break;
    pair<int, int> now = p.top();
    p.pop();
    int len = now.first;
    int start = now.second * -1;
    int endd = start + len - 1;
    cont++;
    if (len & 1) {
      ans[(start + endd) / 2] = cont;
      int newlen = (len - 1) / 2;
      if (newlen == 0) continue;
      int firstStart = start * -1;
      int secondStart = (start + endd) / 2 + 1;
      secondStart *= -1;
      p.push({newlen, firstStart});
      p.push({newlen, secondStart});
    } else {
      ans[(start + endd - 1) / 2] = cont;
      int firstlen = (len - 1) / 2;
      int secondlen = len / 2;
      int firstStart = start * -1;
      int secondStart = (start + endd - 1) / 2 + 1;
      secondStart *= -1;
      if (firstlen != 0) p.push({firstlen, firstStart});
      if (secondlen != 0) p.push({secondlen, secondStart});
    }
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
