#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
struct comparatr {
  bool operator()(pair<long long, long long> const &p1,
                  pair<long long, long long> const &p2) {
    long long l1 = abs(p1.first - p1.second) + 1;
    long long l2 = abs(p2.first - p2.second) + 1;
    if (l1 == l2) return p1.first < p2.first;
    return l1 > l2;
  }
};
vector<long long> solve(long long n) {
  vector<long long> ans(n + 5);
  set<pair<long long, long long>, comparatr> pq;
  pq.insert({1, n});
  long long i = 1;
  while (!pq.empty()) {
    pair<long long, long long> p = *pq.begin();
    long long l = p.first, r = p.second;
    pq.erase(pq.begin());
    long long mid = (l + r) / 2;
    ans[mid] = i++;
    if (l < mid) pq.insert({l, mid - 1});
    if (mid < r) pq.insert({mid + 1, r});
  }
  return ans;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  long long test = 1, N, m, n, h, itr, x, y, i, j, k, z, e, f;
  cin >> test;
  while (test--) {
    cin >> n;
    vector<long long> ans = solve(n);
    for (i = 1; i <= n; i++) cout << ans[i] << " ";
    ans.clear();
    cout << "\n";
  }
  return 0;
}
