#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    priority_queue<pair<long long, pair<long long, long long>>> pq;
    vector<int> answer(n, 0);
    pq.push(make_pair(0LL, make_pair(0, n - 1)));
    int i = 0;
    while (!pq.empty()) {
      pair<long long, pair<long long, long long>> cur = pq.top();
      pq.pop();
      long long start = cur.second.first;
      long long end = cur.second.second;
      long long middle = (start + end) / 2;
      answer[middle] = i + 1;
      if (start != end) {
        pq.push(make_pair((end - (middle + 1)) * n - end,
                          make_pair(middle + 1, end)));
        if (start != middle)
          pq.push(make_pair((middle - 1 - start) * n - middle + 1,
                            make_pair(start, middle - 1)));
      }
      i++;
    }
    for (int x : answer) cout << x << " ";
    cout << '\n';
  }
}
