#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
struct node {
  long long len, r, l;
};
struct fu {
  bool operator()(node const& p1, node const& p2) {
    if (p1.len == p2.len) return p1.l > p2.l;
    return p1.len < p2.len;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    long long c = 1;
    priority_queue<node, vector<node>, fu> pq;
    node x;
    x.l = 0;
    x.r = n - 1;
    x.len = n;
    pq.push(x);
    while (!pq.empty()) {
      long long len = pq.top().len;
      long long l = pq.top().l;
      long long r = pq.top().r;
      pq.pop();
      node x1, x2;
      if ((l - r + 1) % 2) {
        a[(l + r) / 2] = c++;
        long long m1 = (l + r) / 2, m2 = m1;
        m1--;
        m2++;
        x1.l = l, x1.r = m1, x1.len = m1 - l + 1;
        x2.l = m2, x2.r = r, x2.len = r - m2 + 1;
        if (m1 >= l) pq.push(x1);
        if (m2 <= r) pq.push(x2);
      } else {
        a[(l + r - 1) / 2] = c++;
        long long m1 = (l + r - 1) / 2, m2 = m1;
        m1--;
        m2++;
        x1.l = l, x1.r = m1, x1.len = m1 - l + 1;
        x2.l = m2, x2.r = r, x2.len = r - m2 + 1;
        if (m1 >= l) pq.push(x1);
        if (m2 <= r) pq.push(x2);
      }
    }
    for (int i = 0; i < n; i++) cout << a[i] << " ";
    cout << endl;
  }
}
