#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct node {
  int x, y, len, pos;
  bool operator<(const node a) const {
    if (len != a.len)
      return len < a.len;
    else
      return pos > a.pos;
  }
};
int a[N];
priority_queue<node> q;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    memset(a, 0, sizeof a);
    scanf("%d", &n);
    q.push({1, n, n, 1});
    int k = 1;
    while (q.size()) {
      node t = q.top();
      q.pop();
      int l = t.x;
      int r = t.y;
      if (l == r) {
        continue;
      }
      int mid = (l + r) / 2;
      a[mid] = k++;
      int g1 = max(mid - 1, l);
      int g2 = min(mid + 1, r);
      q.push({l, g1, g1 - l + 1, l});
      q.push({g2, r, r - g2 + 1, g2});
    }
    for (int i = 1; i <= n; i++)
      if (a[i] == 0) a[i] = k++;
    for (int i = 1; i <= n; i++) cout << a[i] << " ";
    cout << endl;
  }
  return 0;
}
