#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int arr[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    int n;
    set<pair<int, pair<int, int> > > st;
    cin >> n;
    int a[n];
    int c = 1;
    st.insert(make_pair(-n, make_pair(1, n)));
    int cnt = 0;
    while (cnt < 10) {
      cnt++;
    }
    while (st.size()) {
      pair<int, pair<int, int> > temake_pair = *st.begin();
      int r = temake_pair.second.second;
      int l = temake_pair.second.first;
      st.erase(temake_pair);
      if (l > r) {
        continue;
      }
      if (l == r) {
        arr[l] = c++;
        continue;
      }
      int x = r - l + 1;
      if (x % 2) {
        arr[(l + r) / 2] = c++;
        x = (l + r) / 2;
        st.insert(make_pair(-(x - l), make_pair(l, x - 1)));
        st.insert(make_pair(-(r - x), make_pair(x + 1, r)));
      } else {
        arr[(l + r - 1) / 2] = c++;
        x = (l + r - 1) / 2;
        st.insert(make_pair(-(x - l), make_pair(l, x - 1)));
        st.insert(make_pair(-(r - x), make_pair(x + 1, r)));
      }
    }
    for (int i = 1; i <= n; i++) {
      cout << arr[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
