#include <bits/stdc++.h>
using namespace std;
typedef bool (*comp)(pair<long long, long long>, pair<long long, long long>);
bool compare(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first < b.first;
}
priority_queue<pair<long long, long long>, vector<pair<long long, long long> >,
               comp>
    pq(compare);
long long t, n, Res[500500];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    pq.push({n, 1});
    for (long long i = 1; i <= n; i++) {
      pair<long long, long long> f = pq.top();
      pq.pop();
      long long st = f.second;
      long long en = f.second + f.first - 1;
      long long mid = (st + en) / 2;
      Res[mid] = i;
      pq.push({mid - st, st});
      pq.push({en - mid, mid + 1});
    }
    for (long long i = 1; i <= n; i++) cout << Res[i] << " ";
    cout << endl;
    while (!pq.empty()) pq.pop();
  }
  return 0;
}
