#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  cin >> T;
  for (int tc = 0; tc < T; ++tc) {
    int N;
    cin >> N;
    vector<int> result(N);
    priority_queue<pair<int, pair<int, int>>> que;
    que.emplace(N, make_pair(-1, -N));
    int i = 1;
    while (!que.empty()) {
      auto elem = que.top();
      que.pop();
      int l = -elem.second.first, r = -elem.second.second;
      int m = (l + r) / 2;
      result[m - 1] = i;
      i++;
      if (l < m) que.emplace(m - l, make_pair(-l, -m + 1));
      if (m < r) que.emplace(r - m, make_pair(-m - 1, -r));
    }
    cout << result[0];
    for (int i = 1; i < N; ++i) cout << " " << result[i];
    cout << endl;
  }
}
