def check(l,p):
t=len(l)
j=p[1]-p[0]
for x in range(t):
p1=l[x]
j1=p1[1]-p1[0]
if j1>j:
pass
elif j1<j:
l.insert(x,p)
return l
elif j1==j:
if p1[0]<p[0]:
pass
else:
l.insert(x,p)
return l
l.append(p)
return l
for _ in range(int(input())):
n=int(input())
l1=[0]*n
l=[(0,n-1)]
for x in range(1,n+1):
t=l.pop(0)
ind=(t[1]+t[0])//2
l1[ind]=x
if t[0]<ind:check(l,(t[0],ind-1))
if t[1]>ind:check(l,(ind+1,t[1]))
print(*l1)
ZGVmIGNoZWNrKGwscCk6Cgl0PWxlbihsKQoJaj1wWzFdLXBbMF0KCWZvciB4IGluIHJhbmdlKHQpOgoJCXAxPWxbeF0KCQlqMT1wMVsxXS1wMVswXQoJCWlmIGoxPmo6CgkJCXBhc3MKCQllbGlmIGoxPGo6CgkJCWwuaW5zZXJ0KHgscCkKCQkJcmV0dXJuIGwKCQllbGlmIGoxPT1qOgoJCQlpZiBwMVswXTxwWzBdOgoJCQkJcGFzcwoJCQllbHNlOgoJCQkJbC5pbnNlcnQoeCxwKQoJCQkJcmV0dXJuIGwKCWwuYXBwZW5kKHApCglyZXR1cm4gbApmb3IgXyBpbiByYW5nZShpbnQoaW5wdXQoKSkpOgoJbj1pbnQoaW5wdXQoKSkKCWwxPVswXSpuCglsPVsoMCxuLTEpXQoJZm9yIHggaW4gcmFuZ2UoMSxuKzEpOgoJCXQ9bC5wb3AoMCkKCQlpbmQ9KHRbMV0rdFswXSkvLzIKCQlsMVtpbmRdPXgKCQlpZiB0WzBdPGluZDpjaGVjayhsLCh0WzBdLGluZC0xKSkKCQlpZiB0WzFdPmluZDpjaGVjayhsLChpbmQrMSx0WzFdKSkKCXByaW50KCpsMSkK