#include <bits/stdc++.h>
using namespace std;
bool myfunc(pair<int, int>& a, pair<int, int>& b) {
  if (b.first < a.first) return 1;
  if (b.first == a.first && b.second > a.second) return 1;
  return 0;
}
void dfs(int l, int r, vector<pair<int, int> >& ar) {
  if (r < l) return;
  int mid = (r + l) / 2;
  ar.push_back(make_pair(r - l, mid));
  dfs(l, mid - 1, ar);
  dfs(mid + 1, r, ar);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> res(n);
    vector<pair<int, int> > ar;
    dfs(0, n - 1, ar);
    sort(ar.begin(), ar.end(), myfunc);
    int now = 1;
    for (auto el : ar) {
      res[el.second] = now;
      now++;
    }
    for (int x : res) {
      cout << x << " ";
    }
    cout << "\n";
  }
  return 0;
}
