#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, pair<long long int, long long int>>> v1;
long long int power(long long int x, long long int n) {
  long long int result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x);
    x = x * x;
    n = n / 2;
  }
  return result;
}
using abcd = pair<long long int, pair<long long int, long long int>>;
bool compare(abcd& a1, abcd& a2) {
  long long int s1 = a1.first;
  long long int s2 = a2.first;
  if (s1 != s2) return (s2 < s1);
  long long int p1 = a1.second.first;
  long long int p2 = a2.second.first;
  return (p1 < p2);
}
void fun(long long int start, long long int end) {
  if (start > end) return;
  long long int mid = (start + end) / 2;
  v1.push_back(make_pair(end - start + 1, make_pair(start, end)));
  fun(start, mid - 1);
  fun(mid + 1, end);
}
void solve() {
  long long int n;
  cin >> n;
  fun(0, n - 1);
  sort(v1.begin(), v1.begin() + n, compare);
  vector<long long int> v2(n);
  for (long long int i = 0; i <= n - 1; i++) {
    long long int a1 = (v1[i].second.first + v1[i].second.second) / 2;
    v2[a1] = i + 1;
  }
  for (long long int i = 0; i <= n - 1; i++) cout << v2[i] << " ";
  cout << endl;
  v1.clear();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
}
