#include <bits/stdc++.h>
using namespace std;
const int PI = 3.141592653589793;
const int inf = 1000111222;
const int mod = 1000000007;
const int N = 200007;
bool comp(const pair<int, int> &a, const pair<int, int> &b) {
  int len = a.second - a.first + 1;
  int len2 = b.second - b.first + 1;
  if (len == len2) return a.first < b.first;
  return (len > len2);
}
void solve() {
  int n;
  cin >> n;
  int ar[n + 7];
  set<pair<int, int>, bool (*)(const pair<int, int> &, const pair<int, int> &)>
      S(&comp);
  S.insert({1, n});
  int cnt = 0;
  while (!S.empty()) {
    auto it = S.begin();
    int l = it->first, r = it->second;
    S.erase(it);
    int len = r - l + 1;
    int mid = 0;
    if (len & 1) {
      mid = (l + r) / 2;
    } else {
      mid = (l + r - 1) / 2;
    }
    ++cnt;
    ar[mid] = cnt;
    if (len == 1) continue;
    if (mid > l) S.insert({l, mid - 1});
    if (mid < r) S.insert({mid + 1, r});
  }
  for (int i = 1; i <= n; i++) {
    cout << ar[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
