#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int main() {
  long long t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long n;
    cin >> n;
    long long a[n];
    for (int j = 0; j < n; j++) {
      a[j] = 0;
    }
    long long l = 0, r = n - 1;
    long long it = 1, f2 = 0;
    while (true) {
      long long c = 0, f = 0, c1 = -1, f3 = 1;
      for (int j = 0; j < n + 1; j++) {
        if (j < n && a[j] == 0) {
          c++;
        } else {
          c1 = max(c1, c);
          c = 0;
        }
      }
      c = 0;
      for (int j = 0; j < n + 1; j++) {
        if (j < n && a[j] == 0) {
          c++;
        } else if (c > 0) {
          f = 1;
          if (c == c1) {
            a[j - c / 2 - 1] = it;
            it++;
          }
          c = 0;
        }
      }
      if (f == 0) {
        break;
      }
    }
    for (int j = 0; j < n; j++) {
      cout << a[j] << " ";
    }
    cout << endl;
  }
}
