#include <bits/stdc++.h>
using namespace std;
template <typename type>
struct mycomp {
  bool operator()(const type &first, const type &second) const {
    if (first.first > second.first) {
      return first.first < second.first;
    } else if (first.first == second.first) {
      return first.second > second.second;
    } else {
      return first.first < second.first;
    }
  }
};
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int arr[n + 1];
    priority_queue<pair<int, int>, vector<pair<int, int>>,
                   mycomp<pair<int, int>>>
        q;
    q.push({n, 1});
    int ct = 1;
    while (!q.empty()) {
      pair<int, int> temp2 = q.top();
      q.pop();
      int len = temp2.first;
      pair<int, int> temp;
      temp.first = temp2.second;
      temp.second = temp2.second + temp2.first - 1;
      int idx;
      if (len % 2 == 0) {
        idx = (temp.second + temp.first - 1) / 2;
        arr[idx] = ct;
        ct++;
      } else {
        idx = (temp.second + temp.first) / 2;
        arr[idx] = ct;
        ct++;
      }
      if (len == 2) {
        q.push({1, idx + 1});
      } else if (len != 1 && len % 2 == 0) {
        q.push({temp.second - idx, idx + 1});
        q.push({idx - temp.first, temp.first});
      } else if (len != 1 && len % 2 != 0) {
        q.push({idx - temp.first, temp.first});
        q.push({temp.second - idx, idx + 1});
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
