#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double eps = (double)1e-9;
const double pi = acos(-1.0);
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 200500;
int n, a[N];
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    cin >> n;
    set<pair<int, pair<int, int> > > s;
    s.insert({-n, {1, n}});
    for (int i = 1; i <= n; i++) {
      pair<int, pair<int, int> > p = *s.begin();
      s.erase(s.begin());
      int l = p.second.first;
      int r = p.second.second;
      int mid = (r + l) / 2;
      a[mid] = i;
      if (l < mid) s.insert({-(mid - l), {l, mid - 1}});
      if (mid < r) s.insert({-(r - mid), {mid + 1, r}});
    }
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << "\n";
  }
  return 0;
}
