#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a < b) return b;
  return a;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<int> a(n);
    priority_queue<pair<int, pair<int, int>>> b;
    b.push(make_pair(n - 1, make_pair(0, n - 1)));
    long long low = 0, high = n - 1;
    for (int i = 1; i <= n; i++) {
      pair<int, pair<int, int>> temp = b.top();
      b.pop();
      low = temp.second.first * -1, high = temp.second.second;
      if ((high - low + 1) % 2 == 0) {
        a[(low + high - 1) / 2] = i;
        if (((low + high - 1) / 2) + 1 <= high)
          b.push(make_pair(high - (((low + high - 1) / 2) + 1),
                           make_pair((((low + high - 1) / 2) + 1) * -1, high)));
        if (((low + high - 1) / 2) - 1 >= low)
          b.push(make_pair(((low + high - 1) / 2) - 1 - low,
                           make_pair(low * -1, ((low + high - 1) / 2) - 1)));
      } else {
        a[(low + high) / 2] = i;
        if (((low + high) / 2) - 1 >= low)
          b.push(make_pair(((low + high) / 2) - 1 - low,
                           make_pair(low * -1, ((low + high) / 2) - 1)));
        if (((low + high) / 2) + 1 <= high)
          b.push(make_pair(high - (((low + high) / 2) + 1),
                           make_pair((((low + high) / 2) + 1) * -1, high)));
      }
    }
    for (int i = 0; i < n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
