#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 7;
int num[maxn];
struct Node {
  int x, y;
  bool operator<(const Node& a) const {
    if (y - x == a.y - a.x) return x > a.x;
    return y - x < a.y - a.x;
  }
} node[maxn], mark;
priority_queue<Node> que;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n, temp;
    scanf("%d", &n);
    temp = 1;
    node[1].x = 1, node[1].y = n;
    que.push(node[1]);
    int mid;
    while (!que.empty()) {
      mark = que.top();
      que.pop();
      if ((mark.y - mark.x + 1) % 2 == 1) {
        mid = (mark.y + mark.x) / 2;
      } else {
        mid = (mark.y + mark.x - 1) / 2;
      }
      num[mid] = temp;
      temp++;
      if (mark.x == mark.y) continue;
      Node left, right;
      if (mid > mark.x) {
        left.x = mark.x, left.y = mid - 1;
        que.push(left);
      }
      if (mid < mark.y) {
        right.x = mid + 1, right.y = mark.y;
        que.push(right);
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%d", num[i]);
      if (i < n) printf(" ");
    }
    printf("\n");
  }
  return 0;
}
