#include <bits/stdc++.h>
using namespace std;
struct compare {
  bool operator()(pair<long long int, long long int> &a,
                  pair<long long int, long long int> &b) {
    if ((a.second - a.first) == (b.second - b.first)) {
      return a.first > b.first;
    }
    return (a.second - a.first) < (b.second - b.first);
  }
};
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n == 1) {
      cout << "1\n";
    } else if (n == 2) {
      cout << "1 2\n";
    } else {
      vector<long long int> ans(n);
      priority_queue<pair<long long int, long long int>,
                     vector<pair<long long int, long long int>>, compare>
          pq;
      pq.push({0, n - 1});
      for (long long int i = 1; i <= n; i++) {
        pair<long long int, long long int> tmp = pq.top();
        pq.pop();
        long long int a = tmp.first + (tmp.second - tmp.first) / 2;
        ans[a] = i;
        if (a - 1 >= tmp.first) pq.push({tmp.first, a - 1});
        if (a + 1 <= tmp.second) pq.push({a + 1, tmp.second});
      }
      for (long long int i = 0; i < n; i++) cout << ans[i] << " ";
      cout << endl;
    }
  }
  return 0;
}
