#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    long long int arr[n + 1];
    set<pair<long long int, pair<long long int, long long int>>> tree;
    tree.insert(make_pair(-n, make_pair(1, n)));
    long long int step = 1;
    while (tree.size() > 0) {
      pair<long long int, pair<long long int, long long int>> node =
          *tree.begin();
      long long int l = node.second.first;
      long long int r = node.second.second;
      tree.erase(node);
      if (l > r) {
        continue;
      }
      if (l == r) {
        arr[l] = step++;
        continue;
      }
      if (r - l + 1 % 2 != 0) {
        long long int mid = (l + r) / 2;
        arr[mid] = step++;
        tree.insert(make_pair(-(mid - l), make_pair(l, mid - 1)));
        tree.insert(make_pair(-(r - mid), make_pair(mid + 1, r)));
      } else {
        long long int mid = (l + r - 1) / 2;
        arr[mid] = step++;
        tree.insert(make_pair(-(mid - l), make_pair(l, mid - 1)));
        tree.insert(make_pair(-(r - mid), make_pair(mid + 1, r)));
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    cout << "\n";
  }
  return 0;
}
