#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 2, inf = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    set<pair<int, int> > st;
    st.insert(make_pair(-n, 1));
    int rs[n + 1], cur = 1;
    while (st.size()) {
      auto x = *st.begin();
      int lft = x.second, rgt = -x.first + x.second - 1, idx;
      if (abs(x.first) & 1)
        idx = (rgt + lft) / 2;
      else
        idx = (rgt + lft - 1) / 2;
      rs[idx] = cur++;
      st.erase(*st.begin());
      int a = lft, b = idx - 1, c = idx + 1, d = rgt;
      if (b - a + 1 > 0) st.insert(make_pair(-(b - a + 1), a));
      if (d - c + 1 > 0) st.insert(make_pair(-(d - c + 1), c));
    }
    for (int i = 1; i <= n; i++) cout << rs[i] << " ";
    cout << "\n";
  }
  return 0;
}
