#include <bits/stdc++.h>
using namespace std;
struct Comp {
  bool operator()(const pair<int, int> &a, const pair<int, int> &b) {
    int lenA = a.second - a.first;
    int lenB = b.second - b.first;
    if (lenA < lenB) {
      return true;
    } else if (lenA > lenB) {
      return false;
    } else {
      if (a.first > b.first) {
        return true;
      } else {
        return false;
      }
    }
  }
};
int main() {
  int T, n;
  cin >> T;
  while (T-- > 0) {
    cin >> n;
    vector<int> output(n, 0);
    priority_queue<pair<int, int>, vector<pair<int, int>>, Comp> pq;
    int counter = 1;
    pq.push({0, n - 1});
    while (!pq.empty()) {
      pair<int, int> top = pq.top();
      pq.pop();
      int a = top.first;
      int b = top.second;
      int mid = (a + b) / 2;
      output[mid] = counter++;
      if (mid - a > 0) {
        pq.push({a, mid - 1});
      }
      if (b - mid > 0) {
        pq.push({mid + 1, b});
      }
    }
    for (int i = 0; i < output.size(); i++) {
      cout << output[i];
      if (i != (output.size() - 1)) {
        cout << " ";
      }
    }
    cout << endl;
  }
  return 0;
}
