#include <bits/stdc++.h>
using namespace std;
void file() {
  freopen("max.in", "r", stdin);
  freopen("max.out", "w", stdout);
}
const long long MOD = (long long)1e9 + 7ll;
const long long mod = 998244353;
const long long T = (long long)1e18;
const long long K = (long long)1e9;
const long long N = 3e5 + 100;
const long long tk = 1 << 17;
long long binpow(long long a, long long b) {
  long long ans = 1, k = a;
  while (b) {
    if (b % 2) ans *= k;
    k *= k;
    b /= 2;
  }
  return ans;
}
long long a[N];
long long n, c, r, l, x;
void solve() {
  for (long long i = 1; i <= n; i++) cout << a[i] << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tek;
  cin >> tek;
  while (tek--) {
    cin >> n;
    set<pair<long long, pair<long long, long long>>> st;
    st.insert(make_pair(-n, make_pair(1, n)));
    c = 1;
    while (st.size()) {
      pair<long long, pair<long long, long long>> temp = *st.begin();
      r = temp.second.second;
      l = temp.second.first;
      st.erase(temp);
      if (l - r > 0) continue;
      if (l - r == 0) {
        a[l] = c++;
        continue;
      }
      x = r - l + 1;
      if (!(x % 2)) {
        a[(l + r - 1) / 2] = c++;
        x = (l + r - 1) / 2;
        st.insert(make_pair(-(x - l), make_pair(l, x - 1)));
        st.insert(make_pair(-(r - x), make_pair(x + 1, r)));
      } else {
        a[(l + r) / 2] = c++;
        x = (l + r) / 2;
        st.insert(make_pair(-(x - l), make_pair(l, x - 1)));
        st.insert(make_pair(-(r - x), make_pair(x + 1, r)));
      }
    }
    solve();
  }
  return 0;
}
