#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 5;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t;
  cin >> t;
  while (t--) {
    int n, cnt = 1, l, r, mid;
    cin >> n;
    int a[n + 1];
    priority_queue<pair<int, pair<int, int>>> pq;
    pq.push({n, {-1, -n}});
    while (!pq.empty()) {
      l = -pq.top().second.first;
      r = -pq.top().second.second;
      pq.pop();
      mid = (l + r) / 2;
      a[mid] = cnt;
      cnt++;
      if (l == r) continue;
      if (l < mid) pq.push({mid - l, {-l, -(mid - 1)}});
      if (mid < r) pq.push({r - mid, {-(mid + 1), -r}});
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
