#include <bits/stdc++.h>
using namespace std;
typedef struct _node {
  int left;
  int right;
  int length;
  _node(int left, int right)
      : left(left), right(right), length(right - left + 1) {}
} Node;
struct cmp {
  bool operator()(Node n1, Node n2) {
    if (n1.length < n2.length) {
      return true;
    } else if (n1.length == n2.length) {
      if (n1.left > n2.left) {
        return true;
      }
    }
    return false;
  }
};
int f(int* arr, int left, int right, int idx) {
  int mid = -1;
  if ((right - left + 1) % 2 == 1) {
    arr[(left + right) / 2] = idx;
    mid = (left + right) / 2;
  } else {
    arr[(left + right - 1) / 2] = idx;
    mid = (left + right - 1) / 2;
  }
  return mid;
}
int main() {
  int t;
  scanf("%d", &t);
  for (int tc = 0; tc < t; tc++) {
    int n;
    scanf("%d", &n);
    int arr[200002] = {
        0,
    };
    priority_queue<Node, vector<Node>, cmp> pq;
    pq.push(Node(1, n));
    int idx = 0;
    while (1) {
      idx++;
      if (pq.empty()) {
        break;
      }
      Node temp = pq.top();
      pq.pop();
      int tLeft = temp.left;
      int tRight = temp.right;
      int mid = f(arr, tLeft, tRight, idx);
      if (mid - 1 >= tLeft) {
        pq.push(Node(tLeft, mid - 1));
      }
      if (mid + 1 <= tRight) {
        pq.push(Node(mid + 1, tRight));
      }
    }
    for (int i = 1; i <= n; i++) {
      printf("%d ", arr[i]);
    }
    printf("\n");
  }
}
