#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    vector<int> res(n + 1);
    int mid = (n + 1) / 2;
    res[mid] = n;
    for (int i = mid - 1; i >= 1; i--) res[i] = res[i + 1] - 2;
    for (int i = mid + 1; i <= n; i++) {
      if (i == mid + 1)
        res[i] = res[i - 1] - 2 + 1;
      else
        res[i] = res[i - 1] - 2;
    }
    for (int i = 1; i <= n; i++) cout << res[i] << ' ';
    cout << '\n';
  }
  return 0;
}
