#include <bits/stdc++.h>
using namespace std;
void Main();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int x;
  cin >> x;
  while (~cin.peek()) Main(), cin.get();
  return 0;
}
void Main() {
  int n;
  cin >> n;
  set<pair<int, pair<int, int>>> s;
  s.insert({-n, {1, n}});
  vector<int> a(n + 1);
  int cnt = 1;
  while (s.size()) {
    0;
    auto it = s.begin();
    a[(it->second.first + it->second.second) / 2] = cnt;
    cnt++;
    int len = it->second.second - it->second.first + 1;
    if (len > 2)
      s.insert({-((len - 1) / 2),
                {it->second.first, it->second.first + (len - 1) / 2 - 1}});
    if (len > 1)
      s.insert({-(len - 1 - (len - 1) / 2),
                {it->second.first + (len - 1) / 2 + 1, it->second.second}});
    s.erase(it);
  }
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " \n"[i == n];
  }
}
