#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, i, j, k, l, m, b, t, sum, sum1, flag, max1, min1, tmp;
  cin >> t;
  while (t--) {
    cin >> n;
    long long a[n + 1];
    memset(a, 0, sizeof(a));
    priority_queue<pair<long long, pair<long long, long long>>> p;
    p.push({1, {1, n}});
    i = 1;
    while (!p.empty()) {
      pair<long long, pair<long long, long long>> pq;
      pq = p.top();
      l = pq.first;
      m = pq.second.first;
      b = pq.second.second;
      m = abs(m);
      b = abs(b);
      p.pop();
      a[(m + b) / 2] = i;
      i++;
      j = (m + b) / 2;
      m = j;
      if (m - 1 >= 1 and a[m - 1] == 0) {
        long long d = j;
        while (a[m - 1] == 0) {
          m--;
          if (m == 0) {
            m = 1;
            break;
          }
        }
        d--;
        p.push({d - m + 1, {-m, -d}});
      }
      if (j + 1 <= n and a[j + 1] == 0) {
        long long e = j;
        while (a[j + 1] == 0) {
          j++;
          if (j == n + 1) {
            j = n;
            break;
          }
        }
        e++;
        p.push({j - e + 1, {-e, -j}});
      }
    }
    for (i = 1; i <= n; i++) {
      cout << a[i] << " ";
    }
    cout << endl;
  }
}
