A permutation of length $n$ is an array consisting of $n$ distinct integers from $1$ to $n$ in arbitrary order. For example, $[2,3,1,5,4]$ is a permutation, but $[1,2,2]$ is not a permutation ($2$ appears twice in the array) and $[1,3,4]$ is also not a permutation ($n=3$ but there is $4$ in the array).

For a positive integer $n$, we call a permutation $p$ of length $n$ good if the following condition holds for every pair $i$ and $j$ ($1 \le i \le j \le n$) —   $(p_i \text{ OR } p_{i+1} \text{ OR } \ldots \text{ OR } p_{j-1} \text{ OR } p_{j}) \ge j-i+1$, where $\text{OR}$ denotes the bitwise OR operation. 

In other words, a permutation $p$ is good if for every subarray of $p$, the $\text{OR}$ of all elements in it is not less than the number of elements in that subarray. 

Given a positive integer $n$, output any good permutation of length $n$. We can show that for the given constraints such a permutation always exists.


-----Input-----

Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 100$). Description of the test cases follows.

The first and only line of every test case contains a single integer $n$ ($1 \le n \le 100$).


-----Output-----

For every test, output any good permutation of length $n$ on a separate line. 


-----Example-----
Input
3
1
3
7

Output
1
3 1 2
4 3 5 2 7 1 6



-----Note-----

For $n = 3$, $[3,1,2]$ is a good permutation. Some of the subarrays are listed below.   $3\text{ OR }1 = 3 \geq 2$ $(i = 1,j = 2)$  $3\text{ OR }1\text{ OR }2 = 3 \geq 3$ $(i = 1,j = 3)$  $1\text{ OR }2 = 3 \geq 2$ $(i = 2,j = 3)$  $1 \geq 1$ $(i = 2,j = 2)$ 

Similarly, you can verify that $[4,3,5,2,7,1,6]$ is also good.

Difficulty: EASY
Tags: Mathematics

Constructive algorithms

Starter code:

Solutions:
import math, string, itertools, operator, fractions, heapq, collections, re, array, bisect, sys, functools

def solve(line):
	n = int(line)
	i = 0
	a = [str(i) for i in range(1, n + 1)]
	print(' '.join(a))
T = int(sys.stdin.readline())
t = 0
while True:
	line = sys.stdin.readline().rstrip()
	if not line:
		break
	solve(line)
	t += 1


def single(n):
	for i in range(1, n + 1):
		print(i, end=' ')
t = int(input())
for i in range(t):
	single(int(input()))
	print()


import sys
input = sys.stdin.readline
from collections import *
for _ in range(int(input())):
	n = int(input())
	print(*[i for i in range(1, n + 1)])


def solve(n):
	res = [i + 1 for i in range(n)]
	res.reverse()
	return ' '.join(map(str, res))
cases = int(input())
for _ in range(cases):
	n = int(input())
	print(solve(n))


t = int(input())
while t:
	n = int(input())
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()
	t -= 1


from sys import stdin
from collections import defaultdict
import math
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	print(*range(1, n + 1))


s = input()
while True:
	try:
		s = int(input())
		print(' '.join(list(map(str, [i for i in range(1, s + 1)]))))
	except:
		break


a = int(input())
i = 0
while i < a:
	b = int(input())
	g = ''
	s = 1
	while s <= b:
		g = g + str(s)
		g = g + ' '
		s = s + 1
	print(g)
	i = i + 1


import sys
input = sys.stdin.readline
t = int(input())
for ii in range(t):
	n = int(input())
	print(*[i for i in range(1, n + 1)])


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
	else:
		arr1 = list(range(1, n + 1))
		arr2 = list(range(n, 0, -1))
		ans = []
		if n % 2 != 0:
			for i in range(n // 2 + 1):
				if arr1[i] != arr2[i]:
					ans.append(arr1[i])
					ans.append(arr2[i])
				else:
					ans.append(arr1[i])
			print(*ans)
		else:
			for i in range(n // 2):
				if arr1[i] != arr2[i]:
					ans.append(arr1[i])
					ans.append(arr2[i])
				else:
					ans.append(arr1[i])
			print(*ans)


for i in range(int(input())):
	n = int(input())
	for j in range(1, n + 1):
		print(j, end=' ')
	print()


t = int(input())
while t:
	n = int(input())
	a = [i for i in range(1, n + 1)]
	print(*a)
	t = t - 1


test_cases = int(input())
for _ in range(test_cases):
	n = int(input())
	list_num = [str(i) for i in range(n, 0, -1)]
	result = 0
	for i in list_num:
		result |= int(i)
	if result >= int(list_num[-1]):
		print(' '.join(list_num))


from math import *
from copy import *
from string import *
from random import *
from sys import stdin, stdout
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
import math
import time
from queue import Queue

def seive(n):
	l = [True]
	l = l * (n + 1)
	for i in range(2, int(sqrt(n)) + 1):
		if l[i] == True:
			val = i * i
			while val < len(l):
				l[val] = False
				val += i
	prime = []
	for i in range(2, len(l)):
		if l[i] == True:
			prime.append(i)
	return prime

def dp(l, i, n, val, ans):
	if i >= n or val < 0:
		return 1000000
	elif val == 0:
		return 0
	else:
		if ans[i] == 1000000:
			ans[i] = min(min(1 + dp(l, i + 1, n, val - l[i], ans), 1 + dp(l, i, n, val - l[i], ans)), dp(l, i + 1, n, val, ans))
		return ans[i]
from queue import Queue

def factors(n):
	l = []
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def check1(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v -= 1

def check2(s, v, x):
	while True:
		if v not in s:
			return v
		else:
			v += 1

def up(n):
	j = n - 1
	while j > 0:
		if n % j == 0:
			break
		j -= 1
	return j

def fac(n):
	c = 1
	i = 1
	while i <= n:
		c *= i
		i += 1
	return c

def check_happy(n):
	ss = set()
	print(n)
	while n != 1:
		val = n
		s = 0
		print(val)
		while val != 0:
			s += (val % 10) ** 2
			val = val // 10
		print(val)
		print('hi')
		if val in ss:
			return False
		else:
			n = val
			ss.add(n)
	return True

def update(a, b):
	c = 1
	val = a
	while a < b:
		print(c, a)
		c += c
		a += a
	print(1)
	while a > b:
		print()
		a -= val
		c -= 1
	return c
import random as rand

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)
from itertools import permutations

def insertion_sort(arr):
	for i in range(len(arr)):
		j = i
		while j > 0:
			if arr[j] < arr[j - 1]:
				temp = arr[j]
				arr[j] = arr[j - 1]
				arr[j - 1] = temp
			j -= 1
	return arr

def quick_sort(arr, low, high):
	i = low
	j = high
	while i < j:
		if arr[i] > arr[low] and arr[j] < arr[low]:
			temp = arr[i]
			arr[i] = arr[j]
			arr[j] = arr[i]
			i += 1
			j -= 1
		elif arr[i] <= arr[low]:
			i += 1
		elif arr[j] >= arr[low]:
			j -= 1
	print(i, j)
	toto = arr[j]
	arr[j] = arr[low]
	arr[low] = toto
	return j

def dodo(arr, low, high):
	if low < high:
		val = quick_sort(arr, low, high)
		dodo(arr, low, val - 1)
		dodo(arr, val + 1, high)

def dp(arr, c, n, k, z, ans):
	if k == 0:
		return ans
	elif c == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	elif c == n - 1:
		if z == 0:
			return 0
		else:
			return dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1])
	elif z == 0:
		return dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1])
	else:
		return max(dp(arr, c + 1, n, k - 1, z, ans + arr[c + 1]), dp(arr, c - 1, n, k - 1, z - 1, ans + arr[c - 1]))

def check(arr, val):
	a = -1
	for i in range(len(arr)):
		if arr[i][len(arr[i]) - 1] == val:
			a = i
			break
	return a

def reverse(s, i, ans):
	if i >= len(s):
		return ans
	else:
		return reverse(s, i + 1, s[i] + ans)

def update(arr, i, j, n, m):
	if i >= 0 and i < n and (j >= 0) and (j < m):
		if arr[i][j] == 1:
			arr[i][j] == 2
			return [i, j]
	return [-1, -1]
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	for j in range(1, n + 1):
		l.append(j)
	print(*l)


from functools import reduce
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def inn():
	return int(input())
mo = 1000000007
t = inn()
while t:
	t -= 1
	n = inn()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()


import sys
t = int(sys.stdin.readline())
for _ in range(t):
	n = int(sys.stdin.readline())
	num = [i for i in range(n, 0, -1)]
	print(*num)


__author__ = 'Jethiyaaa'

def solve():
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
for _ in range(int(input())):
	solve()


def sol(n):
	for i in range(n):
		print(i + 1, end=' ')
	print()
k = int(input())
for i in range(k):
	lis = list(map(int, input().split(' ')))
	sol(lis[0])


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	n = int(inp())
	a = []
	for i in range(n, 0, -1):
		a.append(i)
	print(' '.join((str(a[i]) for i in range(n))))
testcase(int(inp()))


import sys
input = sys.stdin.buffer.readline
for tc in range(int(input())):
	n = int(input())
	print(*[i + 1 for i in range(n)])


import sys
t = int(input().strip())
for line in sys.stdin:
	n = int(line.strip())
	print(' '.join(map(str, range(1, n + 1, 1))))


def resolve():
	N = int(input())
	for _ in range(N):
		inputed_number = int(input())
		result = []
		for i in reversed(range(1, inputed_number + 1)):
			result.append(str(i))
		print(' '.join(result))
resolve()


import sys
import heapq
pprint = lambda s: print(' '.join(map(lambda x: str(x), s)))
input = lambda : sys.stdin.readline().strip()
ipnut = input
for i in range(int(input())):
	n = int(input())
	pprint([i + 1 for i in range(n)])


t = int(input())
for i in range(t):
	n = int(input())
	for i in range(1, n + 1):
		if i == n:
			print(i)
		else:
			print(i, end=' ')


import random
t = int(input())
for i in range(t):
	n = int(input())
	lis = []
	for j in range(n):
		lis.append(j + 1)
	flag = 1
	while flag == 1:
		random.shuffle(lis)
		permutation = pow(2, n) - 1
		good_list = True
		for p in range(1, n):
			if not good_list:
				break
			sublist = random.sample(lis, p)
			res_OR = sublist[0]
			if len(sublist) > 1:
				for k in range(1, len(sublist)):
					res_OR |= sublist[k]
			if res_OR >= len(sublist):
				continue
			else:
				good_list = False
		if good_list:
			for h in lis:
				print(h, end=' ')
			print()
			break


for _ in range(int(input())):
	for i in range(1, int(input()) + 1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	print(' '.join([f'{i + 1}' for i in range(n)]))


import sys
import heapq
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	arr = []
	c = 1
	for i in range(n // 2):
		arr.append(i + 1)
		arr.append(n - i)
		c = i + 2
	if len(arr) < n:
		arr.append(c)
	print(*arr)


for tc in range(int(input())):
	N = int(input())
	A = [i for i in range(1, N + 1)]
	import random
	random.shuffle(A)
	print(*A)


import os
from sys import stdin, stdout

def solve(tc):
	n = int(stdin.readline().strip())
	for i in range(n):
		print(i + 1, end=' ')
	print()
tcs = 1
tcs = int(stdin.readline().strip())
tc = 1
while tc <= tcs:
	solve(tc)
	tc += 1


from sys import stdin
from collections import deque
mod = 10 ** 9 + 7
import sys
import random
sys.setrecursionlimit(10 ** 6)
from queue import PriorityQueue
from collections import Counter as cc
from bisect import bisect_right
from bisect import bisect_left
from collections import defaultdict
from math import sqrt, factorial, gcd, log2, inf, ceil
import heapq
input = lambda : sys.stdin.readline().rstrip()
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
from itertools import permutations
from math import factorial as f

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	l = [i + 1 for i in range(n)]
	l.reverse()
	print(*l)


import sys, math, heapq, collections, itertools, bisect
sys.setrecursionlimit(101000)

def solve(n):
	return list(range(1, n + 1))
t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join(map(str, solve(n))))


t = int(input())
for cases in range(t):
	n = int(input())
	k = (n + 1) // 2
	ls = [k]
	p = k + 1
	m = k - 1
	for i in range(n - 1):
		if i % 2 == 0:
			if m >= 1:
				ls.append(m)
				m -= 1
			else:
				ls.append(p)
				p += 1
		elif m <= n:
			ls.append(p)
			p += 1
		else:
			ls.append(m)
			m += 1
	print(*ls)


from os import path
import sys
from heapq import heappush, heappop
from functools import cmp_to_key as ctk
from collections import deque, defaultdict as dd
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from itertools import permutations
from datetime import datetime
from math import ceil, sqrt, log, gcd

def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def bo(i):
	return ord(i) - ord('a')
file = 1

def solve():
	for _ in range(ii()):
		n = ii()
		x = []
		l = 1
		r = n
		while l <= r:
			x.append(l)
			if l != r:
				x.append(r)
			l += 1
			r -= 1
		print(*x)
if file:
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	else:
		input = sys.stdin.readline
solve()


for _ in range(int(input())):
	n = int(input())
	a = [i for i in range(2, n + 1, 2)]
	b = [i for i in range(1, n + 1, 2)]
	c = a + b[::-1]
	c = [str(x) for x in c]
	print(' '.join(c))


def solve(n):
	if n == 1:
		print(1)
		return
	a = n // 2
	b = n // 2 + 1
	while b <= n:
		if a == 0:
			print(b, end=' ')
		else:
			print(b, a, end=' ')
		a -= 1
		b += 1
	print()
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


import sys, math
from collections import Counter, deque, defaultdict
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
I = lambda : int(input())
IN = lambda : input()
C = lambda : input().strip().split()
mod = 1000000007

def s(a):
	print(' '.join(list(map(str, a))))

def solve():
	n = I()
	a = [i for i in range(1, n + 1)]
	s(a)
for _ in range(I()):
	solve()


import math as mt
import sys, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
from collections import defaultdict
n = int(input())
for i in range(n):
	x = I()
	for j in range(x):
		print(j + 1, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	out = ''
	for i in range(n, 0, -1):
		out += str(i) + ' '
	print(out[:-1])


t = int(input())
ns = [int(input()) for i in range(t)]
for n in ns:
	for i in range(1, n + 1):
		print(i)


t = int(input())
while t > 0:
	m = []
	n = int(input())
	for i in range(1, n + 1):
		m.append(str(i))
	print(' '.join(m))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	print(*[k for k in range(1, n + 1)])


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	upper = n // 2 + 1
	lower = upper - 1
	cnt = 0
	ans = []
	while True:
		ans.append(upper)
		cnt += 1
		upper += 1
		if cnt == n:
			break
		ans.append(lower)
		cnt += 1
		lower -= 1
		if cnt == n:
			break
	print(*ans)


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
for _ in range(II()):
	n = II()
	ans = [0] * n
	for i in range(n):
		if i & 1:
			ans[-1 - i // 2] = i + 1
		else:
			ans[i // 2] = i + 1
	print(*ans)


def solve(N):
	return map(str, range(1, N + 1))

def main():
	T = int(input())
	for _ in range(T):
		N = int(input())
		ans = solve(N)
		print(' '.join(ans))
main()


T = int(input())
for t in range(T):
	n = int(input())
	ans = ''
	for i in range(1, n + 1):
		ans = ans + str(i) + ' '
	print(ans)


for n in range(int(input())):
	x = int(input())
	print(*list(range(1, x + 1)))


for _ in range(int(input())):
	n = int(input())
	lst = [i + 1 for i in range(n)]
	lst.reverse()
	print(*lst)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [str(i + 1) for i in range(n)]
	print(' '.join(arr))


l = []
for _ in range(int(input())):
	n = int(input())
	s = str()
	for i in range(1, n + 1):
		s = s + f'{i} '
	l.append(s)
for i in l:
	print(i)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		for i in range(n, 0, -1):
			print(i, end=' ')
		print()
main()


for i in range(int(input())):
	n = int(input())
	l = ''
	for i in range(1, n + 1):
		l += str(i) + ' '
	print(l)


import io, os
from collections import deque
import bisect
RL = lambda : list(map(int, input().split(' ')))
T = int(input())
for _ in range(T):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append(i + 1)
	print(*ans)


from collections import deque
for t in range(int(input())):
	n = int(input())
	q = deque()
	for i in range(n, 0, -1):
		if i % 2 == 0:
			q.append(i)
		else:
			q.appendleft(i)
	print(*q)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(m,) = I()
while m:
	m -= 1
	(n,) = I()
	print(*list(range(1, n + 1)))


def solution(n):
	return ' '.join(list(map(str, range(1, n + 1))))
tests = int(input().strip())
for _ in range(tests):
	n = int(input().strip())
	print(solution(n))


import sys
import collections as cc
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
for tc in range(int(input())):
	(n,) = I()
	a = cc.deque()
	a.append(1)
	k = 2
	for i in range(n - 1):
		if i % 2 == 0:
			a.append(k)
		else:
			a.appendleft(k)
		k += 1
	print(*a)


for s in [*open(0)][1:]:
	print(*range(1, int(s) + 1))


test = int(input())
for t in range(test):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


import sys
input = sys.stdin.readline
LI = lambda : list(map(int, input().strip('\n').split()))
MI = lambda : map(int, input().strip('\n').split())
SI = lambda : input().strip('\n')
II = lambda : int(input().strip('\n'))
for _ in range(II()):
	n = II()
	print(*[i for i in range(1, n + 1)])


MOD = 1000000007
ii = lambda : int(input())
si = lambda : input()
dgl = lambda : list(map(int, input()))
f = lambda : map(int, input().split())
il = lambda : list(map(int, input().split()))
ls = lambda : list(input())
from collections import *
for _ in range(ii()):
	n = ii()
	a = []
	for i in range(n, 0, -1):
		a.append(i)
	print(*a)


for i in [0] * int(input()):
	l = []
	for i in range(int(input())):
		l.append(i + 1)
	print(*l)


import os
import sys
from collections import Counter
from io import BytesIO, IOBase

def main():
	for t in range(int(input())):
		n = int(input())
		a = [i for i in range(1, n + 1)]
		print(*a)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import math
import time
from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from queue import PriorityQueue
import sys
t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
num = inp()
for t in range(num):
	n = inp()
	mylist = []
	for i in range(n):
		mylist.append(i + 1)
	print(*mylist)


t = lambda : range(int(input()))
for _ in t():
	n = int(input())
	print(1, end='')
	for i in range(2, n + 1):
		print(' ', i, end='')
	print('')


t = int(input())

def f(n):
	if n % 2 == 0:
		for i in range(1, n // 2 + 1):
			print(i, n - i + 1, end=' ')
	else:
		for i in range(1, n // 2 + 1):
			print(i, n - i + 1, end=' ')
		print(n // 2 + 1)
for i in range(0, t):
	n = int(input())
	f(n)


t = int(input())
for i in range(t):
	n = int(input())
	k = 0
	a = []
	for j in range(n):
		a.append(j + 1)
	print(*a)


from sys import stdin
N = int(stdin.readline())
for _ in range(N):
	print(' '.join([str(i + 1) for i in range(int(stdin.readline()))]))


for i in range(int(input())):
	a = int(input())
	n = [i for i in range(1, a + 1)]
	print(*n)


t = int(input())
for case in range(t):
	n = int(input())
	listed = [str(a) for a in list(range(1, n + 1))]
	print(' '.join(listed))


t = int(input())
for _ in range(t):
	n = int(input())
	l = []
	for i in range(1, n + 1):
		l.append(i)
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [i for i in range(n, 0, -1)]
	print(' '.join(map(str, a)))


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(range(1, n + 1))
	print(*l)


import math
for _ in range(int(input())):
	ans = ''
	n = int(input())
	for i in range(1, n + 1):
		ans += ' ' + str(i)
	print(ans[1:])


for _ in range(int(input())):
	n = int(input())
	lst = []
	for i in range(1, n + 1):
		lst.append(i)
	print(*lst)


for _ in range(int(input())):
	print(' '.join([str(x + 1) for x in range(int(input()))]))


for _ in range(int(input())):
	print(*(x for x in range(1, int(input()) + 1)))


import sys, math
from collections import deque, defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10 ** 6)
I = sys.stdin.readline

def ii():
	return int(I().strip())

def li():
	return list(map(int, I().strip().split()))

def mi():
	return map(int, I().strip().split())

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	for _ in range(ii()):
		n = ii()
		ans = [i for i in range(n, 0, -1)]
		print(*ans)
main()


from sys import stdin
input = stdin.readline
import math
lines = int(input())
for i in range(lines):
	num = int(input())
	array = []
	for j in range(num):
		array.append(num - j)
	print(*array)


for _ in range(int(input())):
	a = [int(i) for i in range(1, int(input()) + 1)]
	print(*a)


t = int(input())

def solve():
	n = int(input())
	for i in range(n, 0, -1):
		print(i, ' ')
while t:
	solve()
	t -= 1


import sys
from os import path
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def solve():
	n = int(input().strip())
	a = [str(i) for i in range(1, n + 1)]
	print(' '.join(a))

def main():
	tc = int(input().strip())
	for case in range(tc):
		solve()
main()


t = int(input())
for i in range(t):
	n = int(input())
	l = [i + 1 for i in range(n)]
	for i in l:
		print(i, end=' ')
	print()


def solve(n):
	ans = []
	for i in range(n, 0, -1):
		ans.append(i)
	print(' '.join(map(str, ans)))
t = int(input())
for _ in range(t):
	n = int(input())
	solve(n)


for _ in range(int(input())):
	n = int(input())
	list1 = list(range(1, n + 1))
	list2 = []
	i = 0
	while len(list1) != 0:
		if i % 2 == 0:
			list2.append(list1[-1])
			del list1[-1]
		else:
			list2.append(list1[0])
			del list1[0]
		i += 1
	print(*list2)


for i in range(int(input())):
	n = int(input())
	a = []
	for i in range(n, 0, -1):
		a.append(i)
	print(*a)


tests = int(input())
for _ in range(tests):
	m = int(input())
	for i in range(m, 0, -1):
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	print(' '.join([str(j) for j in range(1, n + 1)]))


for _ in range(int(input())):
	n = int(input())
	L = [-1 for i in range(n)]
	cnt = 0
	for i in range(n, 0, -1):
		if cnt % 2 == 0:
			x = (n - i) // 2
			L[x] = i
		else:
			x = (n - i) // 2
			L[n - x - 1] = i
		cnt += 1
	s = ''
	for i in L:
		s = s + str(i) + ' '
	print(s)


from math import ceil
from sys import stdin, stdout, setrecursionlimit
from random import randint
for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	l = [x for x in range(1, n + 1)]
	print(*l)


for _ in range(int(input())):
	N = int(input())
	x = N
	y = 1
	for i in range(1, N + 1):
		if i % 2 == 0:
			print(x, end=' ')
			x -= 1
		else:
			print(y, end=' ')
			y += 1
	print()


for vishal in range(int(input())):
	n = int(input())
	print(' '.join([str(i + 1) for i in range(n)]))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	while n > 0:
		print(n, end=' ')
		n -= 1
	print()


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(1, n + 1):
		a.append(i)
	print(*a)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write(' '.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
from fractions import Fraction
INF = float('inf')
mod = int(1000000000.0) + 7
for t in range(int(data())):
	n = int(data())
	outl(list(range(1, n + 1)))


t = int(input())
for ii in range(t):
	a = int(input())
	b = []
	for i in range(a, 0, -1):
		b.append(str(i))
	c = ' '
	print(c.join(b))


t = int(input())
for T in range(t):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = list(range(1, n + 1))
	print(*arr)


n = int(input().strip())
strings = []
for i in range(n):
	string = ''
	length = int(input().strip())
	for j in range(length):
		string += str(j + 1) + ' '
	strings.append(string[0:-1])
for string in strings:
	print(string)


import sys
input = sys.stdin.readline
T = int(input())
for t in range(T):
	N = int(input())
	print(' '.join(map(str, [i + 1 for i in range(N)])))


t = int(input())
for i in range(t):
	n = int(input())
	ans = []
	j = n
	while j >= 1:
		ans.append(j)
		j += -1
	print(*ans)


for _ in range(int(input())):
	print(' '.join(list(map(str, range(1, int(input()) + 1)))))


for x in range(int(input())):
	n = int(input())
	l = []
	for i in range(n, 0, -1):
		l.append(i)
	print(*l)


tests = int(input())
for test in range(tests):
	n = int(input())
	print(*range(1, n + 1))


from sys import stdin
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	a = [n]
	x = n
	for i in range(n - 1):
		c = (-1) ** i * (n - 1)
		n -= 1
		x = x - c
		a.append(x)
	a = a[::-1]
	print(*a)


for _ in range(int(input())):
	n = int(input())
	print(*[i for i in range(1, n + 1)])


import sys

def main():
	input = sys.stdin.readline
	print = sys.stdout.write
	t = int(input())
	for i1 in [0] * t:
		n = int(input())
		out = []
		for i in range(n, 0, -1):
			out.append(i)
		print(' '.join((str(x) for x in out)))
		print('\n')
main()


for _ in range(int(input())):
	l = [i for i in range(1, int(input()) + 1)]
	print(*l)


for _ in range(int(input())):
	n = int(input())
	zz = []
	for i in range(1, n + 1):
		zz.append(i)
	print(*zz, sep=' ')


(z, zz, dgraphs) = (input, lambda : list(map(int, z().split())), {})
from string import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
num = int(z())
for _ in range(num):
	n = int(z())
	for i in range(n, 0, -1):
		print(i, end=' ')


import random
t = int(input())
arr = []
for i in range(t):
	n = int(input())
	while sum(arr) != sum(range(1, n + 1)):
		arr.append(random.randint(1, n))
		arr = list(set(arr))
	print(' '.join((str(x) for x in arr)))


import itertools

def generateArray(len):
	lst = []
	for i in range(0, len):
		lst.append(i + 1)
	return lst

def checkPermutations(lst):
	lest = []
	for perm in lst:
		valids = 0
		if isinstance(perm, int):
			perm = [perm]
		subsLst = []
		subs = printSubArrays(perm, 0, 0, subsLst)
		for sub in subs:
			buffer = sub[0]
			for i in range(0, len(sub)):
				try:
					buffer = sub[i] | sub[i + 1]
				except:
					pass
			if buffer >= len(sub):
				valids += 1
		if valids == len(subs):
			lest.append(perm)
			return lest

def createPermutations(lst):
	return list(itertools.permutations(lst))

def printSubArrays(arr, start, end, lst):
	if end == len(arr):
		return lst
	elif start > end:
		return printSubArrays(arr, 0, end + 1, lst)
	else:
		lst.append(arr[start:end + 1])
		return printSubArrays(arr, start + 1, end, lst)
tests = int(input())
for i in range(0, tests):
	length = int(input())
	answer = generateArray(length)
	strng = ' '.join(map(str, answer))
	print(strng)


import sys
import math
import collections
import heapq
import queue
import itertools
import functools
import operator
import time
readline = sys.stdin.readline
IPS = lambda : readline().rstrip()
IP = lambda : int(readline().rstrip())
MP = lambda : map(int, readline().split())
LS = lambda : list(map(int, readline().split()))

def solve():
	for _ in range(IP()):
		n = IP()
		for i in range(1, n + 1):
			print(i, end=' ')
		print()
solve()


t = int(input())
while t > 0:
	n = int(input())
	arr = [int(i) for i in range(n, 0, -1)]
	print(*arr, sep=' ')
	t -= 1


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(n + 1):
		l.append(i + 1)
	if n % 2 == 0:
		for i in range(n // 2):
			print(l[i], end=' ')
			print(l[n - i - 1], end=' ')
	else:
		for i in range(n // 2):
			print(l[i], end=' ')
			print(l[n - i - 1], end=' ')
		print(l[n // 2], end=' ')
	print()


query = int(input())
for _ in range(query):
	num = int(input())
	a = list(map(str, range(1, num + 1)))
	print(' '.join(a))


from sys import stdin, stdout
import math
from collections import deque
input = stdin.readline

def print(*args, end='\n'):
	s = []
	for i in args:
		s.append(str(i) + ' ')
	s = ''.join(s)
	stdout.write(s + end)

def solve():
	n = int(input())
	ans = deque([])
	for i in range(1, n + 1):
		if i % 2:
			ans.appendleft(i)
		else:
			ans.append(i)
	for i in ans:
		print(i, end=' ')
	print()
tt = 1
tt = int(input())
for __ in range(tt):
	solve()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	t = I()
	rr = []
	for _ in range(t):
		n = I()
		rr.append(JA(range(1, n + 1), ' '))
	return JA(rr, '\n')
print(main())


from sys import stdin, stdout
import bisect
import math
from collections import deque, Counter
mod = 10 ** 9 + 7

def st():
	return list(stdin.readline().strip())

def inp():
	return int(stdin.readline())

def li():
	return list(map(int, stdin.readline().split()))

def mp():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')

def DFS(dictionary, vertex, visited):
	visited[vertex] = True
	stack = [vertex]
	print(vertex)
	while stack:
		a = stack.pop()
		for i in dictionary[a]:
			if not visited[i]:
				print(i)
				visited[i] = True
				stack.append(i)

def BFS(dictionary, vertex, visited):
	visited[vertex] = True
	q = deque()
	q.append(vertex)
	while q:
		a = q.popleft()
		for i in dictionary[a]:
			if not visited[i]:
				visited[i] = True
				q.append(i)
				print(i)

def soe(limit):
	l = [1] * (limit + 1)
	l[0] = 0
	l[1] = 0
	prime = []
	for i in range(2, limit + 1):
		if l[i]:
			for j in range(i * i, limit + 1, i):
				l[j] = 0
	for i in range(2, limit + 1):
		if l[i]:
			prime.append(i)
	return prime

def segsoe(low, high):
	limit = int(high ** 0.5) + 1
	prime = soe(limit)
	n = high - low + 1
	l = [0] * (n + 1)
	for i in range(len(prime)):
		lowlimit = low // prime[i] * prime[i]
		if lowlimit < low:
			lowlimit += prime[i]
		if lowlimit == prime[i]:
			lowlimit += prime[i]
		for j in range(lowlimit, high + 1, prime[i]):
			l[j - low] = 1
	for i in range(low, high + 1):
		if not l[i - low]:
			if i != 1:
				print(i)

def gcd(a, b):
	while b:
		a = a % b
		(b, a) = (a, b)
	return a

def power(a, n):
	r = 1
	while n:
		if n & 1:
			r = r * a
		a *= a
		n = n >> 1
	return r

def solve():
	n = inp()
	ans = 1
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()
for _ in range(inp()):
	solve()


cases = int(input())
for t in range(cases):
	n = int(input())
	print(*list(range(1, n + 1)))


for _ in range(int(input())):
	n = int(input())
	ans = [str(i) for i in range(n, 0, -1)]
	print(' '.join(ans))


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def Ra():
	return map(int, open(0).read().split())

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
for _ in range(I()):
	ans = 0
	n = I()
	print(*list(range(1, n + 1)))


t = int(input())
for i in range(t):
	n = int(input())
	ans = [str(i) for i in range(1, n + 1)]
	seperator = ' '
	print(seperator.join(ans))


for test in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(i + 1)
	print(*arr)


test = int(input())
for _ in range(test):
	n = int(input())
	for k in range(1, n + 1):
		print(k, end=' ')
	print()


t = int(input(''))
num = []
for i in range(t):
	num.append(int(input('')))
for i in num:
	sol = []
	for j in range(1, i + 1):
		sol.append(j)
	print(*sol)


t = int(input())
for i in range(t):
	n = int(input())
	lis = []
	for j in range(n):
		lis.append(j + 1)
	print(*lis)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
t = inp()
while t > 0:
	n = inp()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
	t -= 1


def number(x):
	number = x // 2
	mumber = number + 1
	while number >= 0 and mumber <= x:
		print(mumber, end=' ')
		if number != 0:
			print(number, end=' ')
		mumber += 1
		number -= 1
	print()
for i in range(int(input())):
	number(int(input()))


import math
from decimal import Decimal
import heapq
import copy
import heapq
from collections import deque
from collections import defaultdict

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def da():
	(n, m) = map(int, input().split())
	a = list(map(int, input().split()))
	return (n, m, a)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def lol(lst, k):
	k = k % len(lst)
	ret = [0] * len(lst)
	for i in range(len(lst)):
		if i + k < len(lst) and i + k >= 0:
			ret[i] = lst[i + k]
		if i + k >= len(lst):
			ret[i] = lst[i + k - len(lst)]
		if i + k < 0:
			ret[i] = lst[i + k + len(lst)]
	return ret

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)

def fact(n):
	tc = []
	ans = {}
	d = 2
	while d * d <= n:
		if n % d == 0:
			tc.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		tc.append(n)
	for i in tc:
		ans[i] = ans.get(i, 0) + 1
	return ans

def to_zero(n, s):
	lst = s[0]
	ans = []
	for i in range(n):
		if lst == s[i]:
			continue
		elif lst == '0':
			lst = '1'
			ans.append(i)
		else:
			lst = '0'
			ans.append(i)
	if lst == '1':
		ans.append(n)
	return ans
for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


tc = int(input())
for _ in range(tc):
	n = int(input())
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	for j in range(int(input())):
		print(str(j + 1), end=' ')
	print()


t = int(input())
while t > 0:
	from collections import deque
	n = int(input())
	li = deque(['1'])
	for i in range(2, n + 1):
		if n % 2 == 1:
			if i % 2 == 0:
				li.append(str(i))
			else:
				li.appendleft(str(i))
		elif i % 2 == 1:
			li.append(str(i))
		else:
			li.appendleft(str(i))
	print(' '.join(li))
	t -= 1


for _ in range(int(input())):
	n = int(input())
	res = []
	for i in range(n, 0, -1):
		res.append(i)
	print(*res)


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def main():
	t = inp()
	for _ in range(t):
		n = inp()
		for i in range(n, 0, -1):
			print(i, end=' ')
		print()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


def solve():
	n = int(input())
	a = [i for i in range(1, n + 1)]
	print(*a)
tst = int(input())
for i in range(tst):
	solve()


for i in range(int(input())):
	x = int(input())
	ans = list(range(1, x + 1))
	ans = list(map(str, ans))
	ans = ' '.join(ans)
	print(ans)


t = int(input())
for items in range(t):
	print(*[int(x) for x in range(1, int(input()) + 1)])


tc = int(input())
while tc:
	n = int(input())
	for i in range(1, n + 1):
		if i == n:
			print(i, end='\n')
		else:
			print(i, end=' ')
	tc -= 1


for i in range(int(input())):
	n = int(input())
	a = [j for j in range(1, n + 1)]
	print(' '.join((str(num) for num in a)))


for _ in range(int(input())):
	n = int(input())
	arr = [int(x) for x in range(1, n + 1)]
	print(*arr)


N = int(input())
for i in range(N):
	print(*[i + 1 for i in range(int(input()))])


import io
import os
from collections import Counter, defaultdict, deque

def solve(N):
	return ' '.join(map(str, reversed(range(1, N + 1))))
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
TC = int(input())
for tc in range(1, TC + 1):
	(N,) = [int(x) for x in input().split()]
	ans = solve(N)
	print(ans)


for o in range(int(input())):
	n = int(input())
	a = []
	for i in range(1, n + 1):
		a.append(i)
	print(*a)


t = int(input())
for i in range(t):
	print(*range(1, int(input()) + 1))


test = int(input())

def solve():
	n = int(input())
	for x in range(1, n + 1):
		print(x, end=' ')
	print('')
for x in range(test):
	solve()


import sys, math, cmath, time
start_time = time.time()

def solve():
	n = inp()
	print(*[n - i for i in range(n)])

def main():
	global tt
	if not ONLINE_JUDGE:
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	t = 1
	t = inp()
	for tt in range(t):
		solve()
	if not ONLINE_JUDGE:
		print('Time Elapsed :', time.time() - start_time, 'seconds')
		sys.stdout.close()

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	return input().strip()

def invr():
	return map(int, input().split())

def counter(a):
	q = [0] * max(a)
	for i in range(len(a)):
		q[a[i] - 1] = q[a[i] - 1] + 1
	return q

def counter_elements(a):
	q = dict()
	for i in range(len(a)):
		if a[i] not in q:
			q[a[i]] = 0
		q[a[i]] = q[a[i]] + 1
	return q

def string_counter(a):
	q = [0] * 26
	for i in range(len(a)):
		q[ord(a[i]) - 97] = (q[ord(a[i]) - 97], 1)
	return q

def factors(n):
	q = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			q.append(i)
			q.append(n // i)
	return list(sorted(list(set(q))))

def prime_factors(n):
	q = []
	while n % 2 == 0:
		q.append(2)
		n = n // 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			q.append(i)
			n = n // i
	if n > 2:
		q.append(n)
	return list(sorted(q))

def transpose(a):
	(n, m) = (len(a), len(a[0]))
	b = [[0] * n for i in range(m)]
	for i in range(m):
		for j in range(n):
			b[i][j] = a[j][i]
	return b
ONLINE_JUDGE = __debug__
if ONLINE_JUDGE:
	input = sys.stdin.readline
main()


import os
from collections import defaultdict, deque
is_dev = 'vscode' in os.environ
if is_dev:
	inF = open('in.txt', 'r')
	outF = open('out.txt', 'w')

def ins(r):
	return list(map(int, r.split(' ')))

def input_():
	if is_dev:
		return inF.readline()[:-1]
	else:
		return input()

def print_(data):
	if is_dev:
		outF.write(str(data) + '\n')
	else:
		print(data)
for _ in range(int(input_())):
	n = int(input_())
	print(' '.join(map(str, list(range(1, n + 1)))))
if is_dev:
	outF.close()

	def compare_file():
		print(open('out.txt', 'r').read() == open('outactual.txt', 'r').read())
	compare_file()


import math
from collections import Counter, defaultdict, deque
from sys import stdin, stdout
input = stdin.readline
I = lambda : int(input())
M = lambda : map(int, input().split())
LI = lambda : list(map(int, input().split()))
for _ in range(I()):
	n = I()
	for i in range(1, n + 1):
		print(i, end=' ')


from sys import stdin, stdout
from math import gcd, sqrt, factorial
from collections import deque
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\n')
L = lambda : list(R())
P = lambda x: stdout.write(x)
lcm = lambda x, y: x * y // gcd(x, y)
hg = lambda x, y: (y + x - 1) // x * x
pw = lambda x: 0 if x == 1 else 1 + pw(x // 2)
chk = lambda x: chk(x // 2) if not x % 2 else True if x == 1 else False
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7
for _ in range(I()):
	n = I()
	print(*[i + 1 for i in range(n)])


for _ in range(int(input())):
	n = int(input())
	liz = []
	for i in range(1, n + 1):
		liz.append(str(i))
	print(' '.join(liz))


t = int(input())
for i in range(t):
	n = int(input())
	arr = [i + 1 for i in range(n)]
	for j in arr:
		print(j, ' ', end='')


import math
import sys
from collections import Counter
from math import factorial as fact
from collections import defaultdict

def inpint():
	return int(input())

def inpstr():
	return str(input())

def inparr():
	return list(map(int, input().strip().split()))

def inptup():
	return map(int, input().strip().split())
for _ in range(inpint()):
	n = inpint()
	for i in range(n):
		print(i + 1, end=' ')
	print()


import math
import sys
import itertools
import random
import bisect
import heapq
import collections

def lcm(x, y):
	return x * y // math.gcd(x, y)

def hcf(x, y):
	return math.gcd(x, y)

def primes(n):
	prime = [True for _ in range(0, n + 1)]
	res = []
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[p] = False
		p += 1
	for i in range(0, n + 1):
		if prime[i] == True:
			res.append(i)
	return res

def primeFactors(n):
	res = []
	while n % 2 == 0:
		res.append(2)
		n //= 2
	for i in range(3, math.sqrt(n) + 1, 2):
		while n % i == 0:
			res.append(i)
			n //= i
	if n > 2:
		res.append(n)
	return res
for _ in range(0, int(input())):
	n = int(input())
	print(' '.join((str(x) for x in range(1, n + 1))))


for j in range(int(input())):
	a = int(input())
	for j in range(1, a + 1):
		print(j, end=' ')
	print('\n')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(range(1, n + 1))
	print(*a)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return s[:len(s) - 1]

def invr():
	return map(int, input().split())

def print_fract(p, q):
	g = math.gcd(p, q)
	p //= g
	q //= g
	print(str(p) + '/' + str(q))
p = 1000000007
T = inp()
for t in range(T):
	N = inp()
	L = [str(i + 1) for i in range(N)]
	print(' '.join(L))


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n):
		if i == n - 1:
			print(n)
			break
		print(i + 1, end=' ')


test_cases = int(input())
for test_case in range(test_cases):
	n = int(input())
	ans = ''
	for i in range(1, n + 1):
		ans += str(i)
		ans += ' '
	print(ans)


def solve():
	n = int(input())
	print(' '.join((str(i) for i in range(1, n + 1))))
K = int(input())
for _ in range(K):
	solve()


import itertools
t = int(input())

def orr(arr):
	res = 0
	for x in arr:
		res = res or x
	return res
while t > 0:
	n = int(input())
	print(f"{' '.join((str(a) for a in list(reversed(list(range(1, n + 1))))))}")
	t -= 1


for tc in range(int(input())):
	n = int(input())
	print(*[i + 1 for i in range(n)])


import sys
tc = int(sys.stdin.readline())
for _ in range(tc):
	n = int(sys.stdin.readline())
	print(' '.join(map(str, [i for i in range(1, n + 1)])))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)

def toord(c):
	return ord(c) - ord('a')

def lcm(a, b):
	return a * b // lcm(a, b)
mod = 998244353
INF = float('inf')
from math import factorial, sqrt, ceil, floor, gcd
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def main():
	for _ in range(N()):
		n = N()
		print(*[i for i in range(1, n + 1)])
main()


testcases = int(input())
for i in range(testcases):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	print(*l)


import sys, math
try:
	(sys.stdin, sys.stdout) = (open('input.txt', 'r'), open('out.txt', 'w'))
except:
	pass
from sys import stdin, stdout
mod = int(1000000000.0 + 7)
from statistics import mode
from collections import *
from math import ceil, floor, inf, factorial, gcd, log2, sqrt, log
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()

def lcm(a, b):
	return a * b // gcd(a, b)

def setbits(n):
	return bin(n).count('1')

def resetbits(n):
	return bin(n).count('0')

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r):
	(num, den) = (1, 1)
	r = min(n, n - r)
	for i in range(r):
		num *= n - i
		den *= i + 1
	return num // den

def ncr_p(n, r, p):
	(num, den) = (1, 1)
	r = min(r, n - r)
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * modinv(den, p) % p

def isPrime(num):
	if num <= 1:
		return False
	if num == 2 or n == 3:
		return True
	if num % 2 == 0 or num % 3 == 0:
		return False
	m = int(num ** 0.5) + 1
	for i in range(5, m, 6):
		if num % i == 0 or num % (i + 2) == 0:
			return False
	return True

def bin_search(arr, low, high, val):
	while low <= high:
		mid = low + (high - low) // 2
		if arr[mid] == val:
			return mid
		elif arr[mid] < val:
			low = mid + 1
		else:
			high = mid - 1
	return -1

def sumofdigit(num):
	count = 0
	while num:
		count += num % 10
		num //= 10
	return count

def inputmatrix():
	(r, c) = iia()
	mat = [0] * r
	for i in range(r):
		mat[i] = iia()
	return (r, c, mat)

def prefix_sum(n, arr):
	for i in range(1, n):
		arr[i] += arr[i - 1]
	return arr

def binomial(n, k):
	if 0 <= k <= n:
		ntok = 1
		ktok = 1
		for t in range(1, min(k, n - k) + 1):
			ntok *= n
			ktok *= t
			n -= 1
		return ntok // ktok
	else:
		return 0

def divisors(n):
	res = []
	for i in range(1, ceil(sqrt(n)) + 1):
		if n % i == 0:
			if i == n // i:
				res.append(i)
			else:
				res.append(i)
				res.append(n // i)
	return res
for i in range(ii1()):
	n = ii1()
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input())
for i in range(0, t):
	n = int(input())
	ns = [x for x in range(1, n + 1)]
	for element in ns:
		print(element, end=' ')


for x in range(int(input())):
	n = int(input())
	while n > 0:
		print(n, end=' ')
		n -= 1
	print()


import math as m
t = int(input())
for i in range(t):
	n = int(input())
	l = []
	j = 0
	while n > 0:
		print(n, end=' ')
		n -= 1


t = int(input())
for i in range(t):
	num = int(input())
	for num in range(num, 0, -1):
		print(num, end=' ')
	print()


t = int(input())
for you in range(t):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	lis = [0 for i in range(0, n + 1)]
	lis2 = 0
	i = 0
	x = 1
	while i < n:
		lis[x] = 1
		print(x, end=' ')
		mx = 0
		val = 0
		for j in range(1, n + 1):
			if lis[j] != 1:
				z = int(i | j)
				if z == n:
					val = j
					mx = z
					break
				if mx <= z:
					val = j
					mx = z
		x = val
		i += 1
	print()


cases = int(input())
for i in range(cases):
	n = int(input())
	arr = []
	if n == 1:
		print(1)
		continue
	arr.append(str(n))
	arr.append(str(1))
	for j in range(1, n):
		if str(j) not in arr:
			arr.append(str(j))
	print(' '.join(arr))


import sys
import math

def addtodic(a, n):
	d = {}
	for i in range(n):
		if a[i] in d:
			d[a[i]] += 1
		else:
			d[a[i]] = 1
	return d

def testcase(n):
	arr = []
	for i in range(n, 0, -2):
		arr.append(i)
	for i in range(n - 1, 0, -2):
		arr.append(i)
	return arr
for _ in range(int(input())):
	n = int(input())
	arr = testcase(n)
	for i in range(n):
		print(arr[i], end=' ')
	print()


import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
T = ni()
for _ in range(T):
	n = ni()
	for i in range(n):
		print(i + 1, end=' ')
	print()


for tt in range(int(input())):
	n = int(input())
	s = ''
	for i in range(n):
		s += str(i + 1) + ' '
	print(s)


def run():
	num = int(input())
	if num == 1:
		print(1)
		return
	else:
		less = [i for i in range(1, num // 2 + 1)]
		more = [i for i in range(num // 2 + 1, num + 1)]
		more.reverse()
		ret = []
		while more or less:
			if more:
				ret.append(more.pop())
			if less:
				ret.append(less.pop())
		print(' '.join([str(i) for i in ret]))
n = int(input())
for i in range(n):
	run()


T = int(input())
while T:
	n = int(input())
	X = [i for i in range(1, n + 1)]
	print(*X)
	T = T - 1


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	arr = []
	for i in range(1, n + 1):
		arr.append(i)
	arr = sorted(arr, reverse=True)
	answer = ''
	for i in arr:
		answer = answer + str(i) + ' '
	answer = answer.strip()
	print(answer)


from sys import stdin, stdout
from itertools import combinations
from collections import defaultdict, Counter
import math

def listIn():
	return list(map(int, stdin.readline().strip().split()))

def stringListIn():
	return [x for x in stdin.readline().split()]

def intIn():
	return int(stdin.readline())

def stringIn():
	return stdin.readline().strip()
t = intIn()
while t > 0:
	t -= 1
	n = intIn()
	ans = list(range(1, n + 1, 1))
	print(*ans)


def h2_gen(n):
	r = range(n // 2 + 1, n + 1)
	for i in r:
		if i == n - 1:
			yield n
		elif r.start != i == n != 1:
			yield (n - 1)
		else:
			yield i

def h1_gen(n):
	for i in range(n // 2, 0, -1):
		yield i
n = int(input())
for i in range(n):
	t = int(input())
	h1 = h1_gen(t)
	h2 = h2_gen(t)
	n = h2
	for j in range(t):
		print(next(n), end=' ')
		n = h1 if n == h2 else h2
	print()


t = int(input())
for i in range(t):
	n = int(input())
	for j in range(n):
		print(n - j, end=' ')
	print('\n')


t = int(input())
a = []
for i in range(t):
	n = int(input())
	a.append(n)
for i in a:
	result = []
	for j in range(1, i + 1):
		result.append(str(j))
	print(' '.join(result))


import sys
input = sys.stdin.readline

def main():
	n = int(input())
	ans = [i for i in range(1, n + 1)]
	print(*ans)
for _ in range(int(input())):
	main()


for _ in range(int(input())):
	a = int(input())
	b = []
	for i in range(1, a + 1):
		b.append(str(i))
	print(' '.join(b))


import math
t = int(input())
while t:
	t -= 1
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


def previous(n):
	n = n | n >> 1
	n = n | n >> 2
	n = n | n >> 4
	n = n | n >> 8
	n = n | n >> 16
	return n - (n >> 1)
t = int(input())
while t > 0:
	n = int(input())
	arr = [0] * n
	l = 1
	k = previous(n)
	if k >= 2:
		arr[0] = k - 1
	if n > 1:
		for i in range(1, n - k + 2):
			arr[i] = k + i - 1
		for i in range(n - k + 2, n):
			arr[i] = l
			l = l + 1
		for i in range(n):
			print(arr[i], end=' ')
		print()
	else:
		print('1')
	t = t - 1


t = int(input())
for i in range(t):
	n = int(input())
	s = []
	for i in range(1, n + 1):
		s.append(i)
	print(*s)


for i in range(int(input())):
	n = int(input())
	a = []
	b = [1, 2, 3, 6]
	for i in range(n + 1):
		if i != 0:
			a.append(i)
	print(*range(1, n + 1))


for _ in range(int(input())):
	n = int(input())
	right = n - 1 + n % 2
	a = []
	while right > 0:
		a.append(right)
		right -= 2
	left = 2
	while left <= n:
		a.append(left)
		left += 2
	print(*a)


t = int(input())
for j in range(t):
	n = int(input())
	p = [l for l in range(n, 0, -1)]
	print(*p)


def list_input():
	return list(map(int, input().split()))

def multiple_input():
	return map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n, 0, -1):
		a.append(i)
	print(*a)


import sys
input = sys.stdin.buffer.readline

def solution():
	n = int(input())
	l = []
	for i in range(1, n + 1):
		l.append(i)
	l.reverse()
	print(*l)
t = int(input())
for _ in range(t):
	solution()


t = int(input())
for i in range(t):
	n = int(input())
	l = [j for j in range(1, n + 1)]
	print(*l)


t = int(input())
for _ in range(t):
	n = int(input())
	a = [x for x in range(1, n + 1)]
	print(*a, sep=' ')


t = int(input())
for i in range(t):
	n = int(input())
	a = [n - i for i in range(n)]
	print(*a)


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	T = int(input())
	for _ in [0] * T:
		N = int(input())
		a = list(range(1, N + 1))
		print(*a[::-1])
main()


def is_good(l):
	for i in range(1, len(l)):
		for j in range(i, len(l)):
			ors = l[i]
			for k in range(i + 1, j + 1):
				ors = ors | l[k]
			if ors < j - i + 1:
				print(l[i:j + 1])
				return False
	return True

def main():
	num_tests = int(input())
	tests = []
	for i in range(num_tests):
		tests.append(int(input()))
	for test in tests:
		for n in range(1, test + 1):
			print(n, end=' ')
		print()
main()


for x in range(int(input())):
	N = int(input())
	List = []
	for i in range(1, N + 1):
		List.append(i)
	print(*List)


from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
from math import sqrt
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	for _ in range(inin()):
		n = inin()
		for i in range(n):
			print(n - i, end=' ')
		print('')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def main(args):
	t = int(input())
	for i in range(t):
		n = int(input())
		arr = [0] * n
		j = n
		k = 1
		for i in range(0, n, 2):
			arr[i] = k
			if i + 1 != n:
				arr[i + 1] = j
				j -= 1
				k += 1
		print(' '.join(map(str, arr)))
import sys
sys.exit(main(sys.argv))


def d4c(n):
	l1 = []
	for i in range(1, n // 2 + 1 + n % 2):
		if n - i + 1 != i:
			l1.append(str(n - i + 1))
			l1.append(str(i))
		else:
			l1.append(str(i))
	return l1
for _ in range(int(input())):
	print(' '.join(d4c(int(input()))))


import sys

def input():
	return sys.stdin.readline().rstrip()

def input_split():
	return [int(i) for i in input().split()]
testCases = int(input())
answers = []
for _ in range(testCases):
	n = int(input())
	ans = list(range(1, n + 1))
	answers.append(ans)
for a in answers:
	print(*a, sep=' ')


n = int(input())
for i in range(n):
	t = input()
	if int(t) == 0 or int(t) == 1:
		print(1, end=' ')
	if int(t) != 1:
		for j in range(1, int(t) + 1):
			print(j, end=' ')
	print()


t = int(input())
while t:
	t -= 1
	n = int(input())
	ans = list(range(n, 0, -1))
	print(*ans)


for i in range(int(input())):
	n = int(input())
	for i in range(n, 0, -1):
		print(i, end=' ')


for _ in range(int(input())):
	n = int(input())
	print(' '.join(map(str, range(1, n + 1))))


def read_int():
	n = int(input())
	return n

def read_ints():
	ints = [int(x) for x in input().split(' ')]
	return ints

def solve(n):
	nums = [str(x) for x in range(1, n + 1)]
	idx = n // 2
	sol = []
	sol.append(nums[idx])
	i = 1
	while len(sol) < n:
		sol.append(nums[idx - i])
		if len(sol) < n:
			sol.append(nums[idx + i])
		i += 1
	return sol
t = read_int()
for case in range(t):
	n = read_int()
	sol = solve(n)
	print(' '.join(sol))


for _ in range(int(input())):
	n = int(input())
	a = [0 for i in range(n)]
	f = n
	cnt = 1
	for i in range(n):
		if i % 2 == 0:
			a[i] = f
			f -= 1
		else:
			a[i] = cnt
			cnt += 1
	print(*a)


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 19
MOD = 10 ** 9 + 7
for _ in range(INT()):
	N = INT()
	ans = list(range(1, N + 1))
	print(*ans)


for i in range(int(input())):
	for j in range(int(input())):
		print(j + 1)


for z in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


from sys import stdin, stdout
input = lambda : stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


import math

def dtb(n):
	return bin(n).replace('0b', '')

def btd(n):
	return int(n, 2)
t = int(input())
for k in range(t):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


testcase = int(input())
limit = []
x = 0
for _ in range(testcase):
	limit.append(int(input()))
for i in limit:
	x = 1
	while x <= i:
		print(x, end=' ')
		x += 1
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [i + 1 for i in range(n)]
	print(*a)


import sys
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	print(*range(1, n + 1))


t = int(input())
for _ in range(t):
	n = int(input())
	ls = [i for i in range(1, n + 1)]
	print(*ls)


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(t,) = I()
for _ in range(t):
	(n,) = I()
	an = [i + 1 for i in range(n)]
	print(*an)


t = int(input())
for _ in range(t):
	print(*range(1, int(input()) + 1))


t = int(input())
m = []
for i in range(t):
	n = int(input())
	m.append([str(j) for j in range(1, n + 1)])
	if n > 1:
		m[i][1] = m[i][n - 1]
		m[i][n - 1] = '2'
for i in range(t):
	print(' '.join(m[i]))


t = int(input())
for i in range(t):
	x = int(input())
	for i in range(x - 1):
		print(i + 1, end=' ')
	print(x)


for i in range(int(input())):
	n = int(input())
	l = []
	for j in range(n):
		l.append(j + 1)
	print(*l)


for t in range(int(input())):
	n = int(input())
	for i in range(n, 0, -1):
		print(i)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = []
	for i in range(n, 0, -1):
		ans.append(i)
	print(*ans)


T = int(input())
for _ in range(T):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	k = [0] * n
	k = [str(x) for x in range(1, n + 1)]
	print(' '.join(k))


import sys
n = int(sys.stdin.readline())
for i in range(n):
	a = sys.stdin.readline()
	l = [i for i in range(1, int(a) + 1)]
	l = ' '.join((str(i) for i in l))
	print(l)


t = int(input())
perm = []
for i in range(t):
	perm.append(int(input()))
for i in range(t):
	for j in range(perm[i]):
		print(j + 1, '', end='')
	print()


from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left
from bisect import bisect_right

def L():
	return list(map(int, stdin.readline().split()))

def In():
	return map(int, stdin.readline().split())

def I():
	return int(stdin.readline())
P = 1000000007

def main():
	for t in range(I()):
		n = I()
		if n == 1:
			print(1)
		else:
			for i in range(n):
				print(n - i, end=' ')
			print()
main()


t = int(input())
for iter in range(t):
	n = int(input())
	array = [0] * n
	for i in range(0, n):
		array[i] = i + 1
	bitwise_sum = array[0]
	for i in range(n):
		for j in range(n):
			if j == i:
				continue
			if array[i] | array[j] >= j - i + 1:
				continue
			else:
				print('BAD Permutation')
				break
	for i in array:
		print(i)


t = int(input())
for i in range(t):
	f = lambda : map(int, input().split(' '))
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
for q in range(t):
	n = int(input())
	s = ''
	for i in range(1, n + 1):
		s += str(i) + ' '
	print(s)


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect
from collections import deque, defaultdict, OrderedDict
import collections
N = 100009
factorialNumInverse = [None] * (N + 1)
naturalNumInverse = [None] * (N + 1)
fact = [None] * (N + 1)

def InverseofNumber(p):
	naturalNumInverse[0] = naturalNumInverse[1] = 1
	for i in range(2, N + 1, 1):
		naturalNumInverse[i] = naturalNumInverse[p % i] * (p - int(p / i)) % p

def InverseofFactorial(p):
	factorialNumInverse[0] = factorialNumInverse[1] = 1
	for i in range(2, N + 1, 1):
		factorialNumInverse[i] = naturalNumInverse[i] * factorialNumInverse[i - 1] % p

def factorial(p):
	fact[0] = 1
	for i in range(1, N + 1):
		fact[i] = fact[i - 1] * i % p

def Binomial(N, R, p):
	ans = fact[N] * factorialNumInverse[R] % p * factorialNumInverse[N - R] % p
	return ans

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	p = 1000000007
	InverseofNumber(p)
	InverseofFactorial(p)
	factorial(p)
	for _ in range(ri()):
		n = ri()
		z = []
		for i in range(n):
			z.append(i + 1)
		print(*z)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

	def flush(self):
		os.write(self._fd, self.buffer.getvalue())
		(self.buffer.truncate(0), self.buffer.seek(0))

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


import math
num_cases = int(input())
for _ in range(num_cases):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	c = [i + 1 for i in range(int(input()))]
	print(*c)


def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def mi():
	return map(int, input().split())

def main():
	for i in range(ii()):
		n = ii()
		i = 1
		while i < n + 1:
			print(i, end=' ')
			i += 1
		print()
main()


t = int(input())
sol = []
for i in range(t):
	n = int(input())
	l = [str(x) for x in range(1, n + 1)]
	sol.append(' '.join(l))
for i in sol:
	print(i)


import sys
T = int(sys.stdin.readline())
for i in range(T):
	N = int(sys.stdin.readline())
	nums = [N] + [x + 1 for x in range(N - 1)]
	print(' '.join([str(x) for x in nums]))


import sys, threading, os.path
import string
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)

def main():
	if os.path.exists('in.rtf'):
		input = open('in.rtf', 'r')
	else:
		input = sys.stdin
	n = int(input.readline())
	results = []
	for i in range(n):
		m = int(input.readline())
		result = []
		for j in range(1, m + 1):
			result.append(j)
		results.append(result)
	output = ''
	for i in range(len(results)):
		output += ' '.join(map(str, results[i]))
		if i + 1 < len(results):
			output += '\n'
	if os.path.exists('out.rtf'):
		open('out.rtf', 'w').writelines(str(output))
	else:
		sys.stdout.write(str(output))
main()


T = int(input())
for _ in range(0, T):
	n = int(input())
	L = []
	for i in range(1, n + 1):
		L.append(i)
	print(*L)


for _ in range(int(input())):
	n = int(input())
	array = sorted([int(x) for x in range(1, n + 1)])
	if n == 1:
		print(1)
	else:
		print(*array)


def get_ints():
	return list(map(int, list(input().split())))

def get_int():
	return int(input())
t = get_int()
for i in range(t):
	n = get_int()
	for j in range(1, n + 1):
		print(j, end=' ')


from sys import stdin
for i in range(int(input())):
	n = int(input())
	a = [n - i for i in range(n)]
	print(*a)


t = int(input())
for _ in range(t):
	n = int(input())
	r = [0] * n
	for i in range(1, n + 1):
		if i % 2 == 1:
			r[i // 2] = i
		else:
			r[-(i // 2)] = i
	for i in range(n):
		print(r[i], end=' ')
	print()


import math
import os
import random
import re
import sys
from collections import defaultdict, Counter, deque
import heapq
from functools import lru_cache
from itertools import accumulate, chain, combinations, permutations, groupby, zip_longest
from math import floor, ceil, sqrt

def solve(n):
	d = deque()
	for i in range(1, n + 1):
		if i % 2:
			d.appendleft(i)
		else:
			d.append(i)
	return ' '.join((str(x) for x in d))
t = int(input())
N = [int(input()) for _ in range(t)]
for n in N:
	print(solve(n))


from collections import defaultdict
con = 10 ** 9 + 7
INF = float('inf')

def getlist():
	return list(map(int, input().split()))

def main():
	T = int(input())
	for _ in range(T):
		N = int(input())
		ans = [i + 1 for i in range(N)]
		print(*ans)
main()


t = int(input())
for i in range(0, t):
	n = int(input())
	sample = []
	for i in range(1, n + 1):
		sample.append(i)
	print(*sample)


from sys import *
from math import *
t = int(stdin.readline())
for _ in range(t):
	n = int(stdin.readline())
	a = []
	for i in range(n, 0, -1):
		a.append(i)
	print(*a)


from sys import stdin
t = int(input())
for _ in range(t):
	n = int(input())
	ans = []
	for i in range(n, 0, -1):
		ans.append(i)
	print(*ans)


test_cases = int(input())
for e in range(test_cases):
	lenght = int(input())
	print(*list(range(1, lenght + 1)))


TC = int(input())
for tc in range(TC):
	N = int(input())
	result = []
	for i in range(1, N + 1):
		print(i, end=' ')
	print()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class union_find:

	def __init__(self, n):
		self.n = n
		self.rank = [0] * n
		self.parent = [int(j) for j in range(n)]

	def union(self, i, j):
		i = self.find(i)
		j = self.find(j)
		if self.rank[i] == self.rank[j]:
			self.parent[i] = j
			self.rank[j] += 1
		elif self.rank[i] > self.rank[j]:
			self.parent[j] = i
		else:
			self.parent[i] = j

	def find(self, i):
		temp = i
		if self.parent[temp] != temp:
			self.parent[temp] = self.find(self.parent[temp])
		return self.parent[temp]
from math import log2, ceil
from collections import deque, Counter as CC

def main():
	for t in range(int(input())):
		n = int(input())
		l = [print(i + 1, end=' ') for i in range(n)]
		print()
main()


def main():
	t = int(input())
	for _ in range(t):
		print(' '.join(map(str, [i + 1 for i in range(int(input()))])))
main()


t = int(input())
cnt = 0
while cnt < t:
	cnt += 1
	n = int(input())
	print(' '.join((str(i) for i in range(1, n + 1))))


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = int(fastinput())
while t:
	t -= 1
	n = int(fastinput())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
for case in range(t):
	n = int(input())
	print(*[i + 1 for i in range(n)])


t = int(input())
for i in range(t):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	print(*l, sep=' ')


import sys
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : sys.stdin.readline().strip().split()
ri = lambda : int(sys.stdin.readline().strip())
rs = lambda : sys.stdin.readline().strip()
from collections import defaultdict as df
import random
from queue import PriorityQueue as pq
from math import ceil
t = ri()
for _ in range(t):
	n = ri()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	print(*[*range(1, n + 1)])


import sys
import math

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	ans = []
	for i in range(1, n + 1):
		ans.append(i)
	print(*ans)


t = int(input())
for q in range(t):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


n = int(input())
for i in range(n):
	a = int(input())
	l = list(range(1, a + 1))
	print(*l)


num = int(input())
for _ in range(num):
	i = int(input())
	print(' '.join([str(i) for i in list(range(1, i + 1))]))


from sys import stdin, stdout
q = int(input())
for i in range(q):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


from sys import stdin

def inp():
	return stdin.buffer.readline().rstrip().decode('utf8')

def itg():
	return int(stdin.buffer.readline())

def mpint():
	return map(int, stdin.buffer.readline().split())
for case in range(1, itg() + 1):
	print(*range(1, itg() + 1))


t = int(input())
for _ in range(t):
	n = [x for x in range(1, int(input()) + 1)]
	n.reverse()
	print(*n)


import sys, math
input = sys.stdin.readline
t = int(input())
for r in range(t):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input())
for test in range(t):
	n = int(input())
	s = set(range(n + 1))
	s.pop()
	print(*s)
	s = list(s)
	f = True


for _ in range(int(input())):
	print(*list(range(1, int(input()) + 1)))


def main():
	(n,) = map(int, input().split(' '))
	v1 = 1
	v2 = n
	f = True
	for t in range(n):
		if f:
			print(v1, end=' ')
			v1 += 1
		else:
			print(v2, end=' ')
			v2 -= 1
		f = not f
	print()
for _ in range(int(input())):
	main()


from sys import stdin
_input = stdin.readline
(_list, _int, _range) = (list, int, range)

def solution():
	for _ in _range(_int(_input())):
		n = _int(_input())
		print(n, *_list(_range(1, n)))
solution()


t = int(input())
for i in range(t):
	n = int(input())
	result = ''
	for x in list(range(1, n + 1)):
		result += str(x) + ' '
	print(result[:-1])


def f():
	n = int(input(' '))
	for i in range(1, n + 1):
		print(i, end=' ')
n = int(input(''))
for i in range(n):
	f()


import math

def solve():
	n = int(input())
	l = [i for i in range(1, n + 1)]
	l = l[::-1]
	for i in l:
		print(i, end=' ')
	print()
t = 1
t = int(input())
while t > 0:
	t -= 1
	solve()


for z in range(int(input())):
	n = int(input())
	print(*range(1, n + 1))


t = int(input())
while t > 0:
	n = int(input())
	print(' '.join((str(num) for num in range(1, n + 1))))
	t -= 1


def perm(n):
	if n == 1:
		return 1
	else:
		f = [*range(1, n + 1)]
		f = list(map(str, f))
		return ' '.join(f)
t = int(input())
for i in range(t):
	n = int(input())
	print(perm(n))


import math
t = int(input())
for w in range(t):
	n = int(input())
	print(*[i for i in range(n, 0, -1)])


t = int(input())

def solve(n):
	ans = [i for i in range(1, n + 1)]
	print(*ans)
	return
for _ in range(t):
	n = int(input())
	solve(n)


for _ in range(int(input())):
	print(*range(int(input()), 0, -1))


import sys
from sys import stdin
from collections import Counter
import itertools
from math import floor, ceil
from collections import deque
from math import sin, cos

def input():
	return sys.stdin.readline().strip()

def dinput():
	return int(input())

def tinput():
	return input().split()

def rinput():
	return map(int, tinput())

def rlinput():
	return list(rinput())

def sinput():
	return sys.stdin.read()

def rt(n):
	if n == 0:
		return 1
	else:
		return n * rt(n - 1)

def main():
	print(*[i for i in range(1, dinput() + 1)])
for test in range(dinput()):
	main()


def con(v):
	l = []
	for j in v:
		j = str(j)
		l.append(j)
	return ' '.join(l)
t = int(input())
i = 0
while i < t:
	n = int(input())
	k = []
	for s in range(1, n + 1):
		k.append(s)
	print(con(k))
	i += 1


import sys
from collections import defaultdict as dd
from collections import deque
from functools import *
from fractions import Fraction as f
from copy import *
from bisect import *
from heapq import *
from math import *
from itertools import permutations

def eprint(*args):
	print(*args, file=sys.stderr)
zz = 1
if zz:
	input = sys.stdin.readline
else:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('all.txt', 'w')

def inc(d, c):
	d[c] = d[c] + 1 if c in d else 1

def li():
	return [int(xx) for xx in input().split()]

def fli():
	return [float(x) for x in input().split()]

def comp(a, b):
	if a > b:
		return 2
	return 2 if a == b else 0

def gi():
	return [xx for xx in input().split()]

def fi():
	return int(input())

def pro(a):
	return reduce(lambda a, b: a * b, a)

def swap(a, i, j):
	(a[i], a[j]) = (a[j], a[i])

def si():
	return list(input().rstrip())

def mi():
	return map(int, input().split())

def gh():
	sys.stdout.flush()

def isvalid(i, j):
	return 0 <= i < n and 0 <= j < n

def graph(n, m):
	for i in range(m):
		(x, y) = mi()
		a[x].append(y)
		a[y].append(x)

def bo(i):
	return ord(i) - ord('A')

def ck(x, y):
	return int(bin(x)[2:] + bin(y)[2:], 2)
t = fi()
while t > 0:
	t -= 1
	n = fi()
	print(*[i for i in range(1, n + 1)])


def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
n = inp()
for _ in range(n):
	m = inp()
	ans = ''
	for i in range(m):
		ans += str(i + 1) + ' '
	print(ans)


test = int(input())
for _ in range(test):
	n = int(input())
	arr = [i for i in range(1, n + 1)]
	print(*sorted(arr, reverse=True))


for i in range(int(input())):
	n = int(input())
	print(*list(range(1, n + 1)))


for _ in range(int(input())):
	n = int(input())
	ar = [int(i) for i in range(1, n + 1)]
	ar1 = [0] * (n + 1)
	j = 1
	i = 0
	while j < n:
		ar1[j] = ar[i]
		j += 2
		i += 1
	j = 0
	while j < n:
		ar1[j] = ar[i]
		j += 2
		i += 1
	print(*ar1[0:-1])


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(range(1, n + 1))
	print(' '.join(list(map(str, l))))


def ii():
	return int(input())

def si():
	return input().rstrip()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
for _ in range(ii()):
	n = ii()
	x = []
	l = 1
	r = n
	while l <= r:
		x.append(l)
		if l != r:
			x.append(r)
		l += 1
		r -= 1
	print(*x)


import random

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
for _ in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print('')


n = int(input())
for i in range(n):
	x = int(input())
	if x == 1:
		print(1)
	else:
		count = 1
		for j in range(1, x):
			if j | j + 1 >= 2:
				count += 1
		if count == x:
			for a in range(1, x + 1):
				print(a, end=' ')
			print()


def tc():
	n = int(input())
	arr = list(range(1, n + 1))
	print(' '.join(map(str, arr)))
T = int(input())
for _ in range(T):
	tc()


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		print(i + 1, end=' ')


n = int(input())
for i in range(n):
	m = int(input())
	res = ' '.join([str(l) for l in range(m, 0, -1)])
	print(res)


t = int(input())
while t:
	t -= 1
	n = int(input())
	ls = list(range(1, n + 1))
	ls.sort()
	print(*ls)


for _ in range(int(input())):
	n = int(input())
	arr = [i for i in range(1, n + 1)]
	j = n - 1
	i = 0
	check = True
	for _ in range(n):
		if check:
			print(arr[j], end=' ')
			j -= 1
		else:
			print(arr[i], end=' ')
			i += 1
		check = not check
	print()


import sys
T = int(sys.stdin.readline())
for t in range(T):
	N = int(sys.stdin.readline())
	for e in range(N):
		print(e + 1, end=' ')
	print()


from sys import stdin
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	for i in range(n):
		print(i + 1, end=' ')
	print()


from sys import stdout, stdin
from collections import defaultdict
t = int(input())
for _ in range(t):
	n = int(input())
	l = [i + 1 for i in range(n)]
	print(*l)


from functools import reduce

def _or(x, y):
	return x | y
for _ in range(int(input())):
	n = int(input())
	a = list(range(1, n + 1))
	print(*a)


for i in range(int(input())):
	n = int(input()) + 1
	ans = [int(j) for j in range(1, n)]
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	l = [0] * n
	c = n
	i = 0
	p = 1
	if n % 2 == 1:
		c -= 1
		i += 1
		l[0] = n
		n -= 1
	while i < n:
		l[i] = p
		l[i + 1] = c
		c -= 1
		p += 1
		i += 2
	print(*l)


from itertools import permutations

def soln(n):
	arr = [i for i in range(1, n + 1)]
	x = permutations(arr)
	for i in x:
		sol = True
		for j in range(n):
			ans = i[j]
			for k in range(j + 1, n):
				ans |= i[k]
				if ans < k - j + 1:
					sol = False
					break
			if not sol:
				break
		if sol:
			return i
t = int(input())
for _ in range(t):
	n = int(input())
	ans = soln(n)
	print(*[x for x in ans])


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	a = []
	for i in range(1, n + 1):
		a.append(i)
	print(*a, sep=' ')


t = int(input())
for i in range(t):
	n = int(input())
	r = '1'
	for j in range(2, n + 1):
		r += ' ' + str(j)
	print(r)


t = int(input())
for _ in range(t):
	n = int(input())
	result = 0
	for i in (1, n + 1):
		result = result | i
	if result >= n:
		for i in range(1, n + 1):
			print(i, end=' ')
	print(' ')


t = int(input())
for k in range(t):
	n = int(input())
	if n % 2 == 0:
		for i in range(int(n / 2)):
			print(int(n) - i, end=' ')
			print(int(n / 2 - i), end=' ')
	if n % 2 == 1:
		for i in range(int(n / 2) + 1):
			print(n - i, end=' ')
			if int(n / 2) - i == 0:
				break
			print(int(n / 2) - i, end=' ')


for i in range(int(input())):
	n = int(input())
	arr = [i for i in range(1, n + 1)]
	print(*arr)


def solve(n):
	return ' '.join((str(s) for s in range(1, n + 1)))
t = int(input())
for i in range(0, t):
	n = int(input())
	print(solve(n))


from sys import stdin, stdout, setrecursionlimit
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log, log2
from random import seed, randint
from datetime import datetime
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
from collections import defaultdict as dd
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def def_value():
	return 0
for _ in range(iinp()):
	n = iinp()
	a = [i for i in range(1, n + 1)]
	print(*a)


cases = int(input())
while cases:
	cases -= 1
	n = int(input())
	print(*list(range(n, 0, -1)))


x = int(input())
for _ in range(x):
	n = int(input())
	evens = ''
	odds = ''
	for i in range(1, n + 1):
		if i % 2 == 0:
			evens += str(i) + ' '
		else:
			odds += str(i) + ' '
	print(evens + odds)


import re
ls = lambda : list(map(int, input().split()))
ip = lambda : int(input())
sip = lambda : input()
r = lambda a: range(a)
lcm = lambda a, b: abs(a * b) // math.gcd(a, b)
t = ip()
for _ in r(t):
	n = ip()
	m = list(range(1, n + 1))
	print(*m, end=' ')
	print()


def prob_1(n):
	ans = []
	for i in range(1, n + 1):
		ans.append(i)
	ans = str(ans)
	ans = ans.replace(',', ' ')
	return ans[1:-1]
n = int(input())
ans = []
for i in range(n):
	length = int(input())
	ans.append(prob_1(length))
for i in ans:
	print(i)


t = int(input())
for _ in range(t):
	n = int(input())
	ans = [0] * n
	for i in range(0, n, 2):
		ans[i] = i + 1
	for i in range(1, n, 2):
		if n % 2 == 1:
			ans[n - i - 1] = i + 1
		else:
			ans[n - i] = i + 1
	print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	li = []
	for j in range(n, 0, -1):
		li.append(j)
	for k in li:
		print(k, sep=' ', end=' ')
	print()


from math import ceil

def DTB(n):
	return bin(n).replace('0b', '')
for abcd in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


from sys import stdin
import math
inp = lambda : stdin.readline().strip()
t = int(inp())
for _ in range(t):
	print(*list(range(1, int(inp()) + 1)))


t = int(input())
a = list()
for i in range(t):
	a.append(int(input()))
for i in range(t):
	for j in range(a[i]):
		print(j + 1, end='')
		print(' ', end='')
	print()


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
for _ in range(r()):
	n = r()
	a = []
	for i in range(n):
		a.append(i + 1)
	print(*a)


try:
	t = int(input())
	while t:
		n = int(input())
		for i in range(1, n + 1):
			print(i, end=' ')
		print(end='\n')
except:
	pass


def f(a, b):
	return str(a) + ' ' + str(b)

def docase(n):
	a = ''
	for x in range(int(n)):
		a += str(x + 1) + ' '
	return a

def main():
	cases = int(input())
	for case in range(int(cases)):
		n = int(input())
		r = docase(n)
		print(r)
main()
exit()


t = int(input())
for _ in range(t):
	n = int(input())
	for x in range(n):
		print(x + 1, end=' ')
	print()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
for _ in range(int(ri())):
	n = int(ri())
	ans = []
	for i in range(1, n + 1):
		ans.append(i)
	print(*ans)


n = int(input())
for i in range(n):
	t = int(input())
	count = 0
	a = []
	for i in range(t + 1):
		for j in range(i, t + 1):
			if i | j >= j - i + 1:
				a.append(i)
				a.append(j)
	a = set(a)
	for i in a:
		print(i, end=' ')


test = int(input())
while test:
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
	test -= 1


t_case = int(input())
for _ in range(t_case):
	a = int(input())
	for i in range(a, 0, -1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	if n >= 1:
		for i in range(n):
			k = n - i
			print(k, end=' ')
	print('\n', end='')


test_n = int(input())
for _ in range(test_n):
	n = int(input())
	h_1 = iter(range(n // 2, 0, -1))
	h_2 = iter(range(n // 2 + 1, n + 1))
	now = h_2
	for i in range(n):
		print(next(now), end=' ')
		now = h_1 if now == h_2 else h_2
	print()


for test_case in range(int(input())):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


import collections
import sys

def solve():
	n = int(input())
	res = ' '.join((str(i) for i in range(1, n + 1)))
	return res
for _ in range(int(input())):
	print(solve(), '\n')


T = int(input())
while T:
	n = int(input())
	odd = []
	even = []
	for i in range(1, n + 1):
		if i & 1:
			odd.append(i)
		else:
			even.append(i)
	ret = even + odd
	print(*ret)
	T -= 1


import math

def mi():
	return map(int, input().split())

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return input().split()
t = ii()
for _ in range(t):
	n = ii()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


T = int(input())
for t in range(1, T + 1):
	N = int(input())
	x = [j + 1 for j in range(N)]
	print(*x)


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
	else:
		for j in range(1, n + 1):
			print(j, end=' ')
		print()


for _ in range(int(input())):
	x = int(input())
	x1 = [int(i) for i in range(1, x + 1) if i % 2 == 0]
	x2 = [int(i) for i in range(1, x + 1) if i % 2 != 0]
	print(*x1 + x2, sep=' ')


k = int(input())
for _ in range(k):
	n = int(input())
	data = []
	for i in range(1, n + 1):
		data.append(i)
	print(*data)
	data = []


t = int(input())
for q in range(t):
	n = int(input())
	for x in range(1, n + 1):
		print(x, end=' ')
	print()


from collections import defaultdict as dd
import math
import sys
import string
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve():
	n = nn()
	ans = []
	for i in range(1, n + 1):
		ans.append(i)
	print(*ans)
q = nn()
for _ in range(q):
	solve()


for ctr in range(int(input())):
	n = int(input())
	ans = []
	for x in range(n):
		ans.append(x + 1)
	print(*ans)


from itertools import permutations

def check2(a, b, array):
	oper = array[a - 1]
	for k in range(a + 1, b + 1):
		oper = oper | array[k - 1]
	if oper >= b - a + 1:
		return False
	else:
		return True

def check1(array):
	size = len(array)
	for i in range(size - 1):
		for j in range(i + 1, size):
			if check2(i + 1, j + 1, array):
				return False
	return True
test_case = int(input())
for _ in range(test_case):
	n = int(input())
	array = list(range(1, n + 1))
	arr_per = permutations(array)
	for i in arr_per:
		if check1(i):
			ans = i
			break
	for i in ans:
		print(i, end=' ')
	print('')


t = int(input())
for i in range(t):
	n = int(input())
	c = []
	for j in range(1, n + 1):
		c.append(j)
	print(' '.join(map(str, c)))


import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
t = inp()
for _ in range(t):
	n = inp()
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	lst = [i for i in range(1, int(input()) + 1)]
	print(*lst)


import sys
import math
import heapq
import collections
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')

def printspace(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer(' ')

def inputnum():
	return int(input())

def inputnums():
	return map(int, input().split())

def inputlist():
	return list(map(int, input().split()))

def inputstring():
	return [x for x in input()]

def inputmatrixchar(rows):
	arr2d = [[j for j in input().strip()] for i in range(rows)]
	return arr2d

def inputmatrixint(rows):
	arr2d = []
	for _ in range(rows):
		arr2d.append([int(i) for i in input().split()])
	return arr2d
t = int(input())
for q in range(t):
	n = inputnum()
	for i in range(1, n + 1):
		printspace(i)
	print()


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
from decimal import Decimal
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var, end='\n'):
	sys.stdout.write(str(var) + end)

def outa(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
for _ in range(int(data())):
	n = int(data())
	outa(*[i for i in range(1, n + 1)])


t = int(input())
for asdas in range(t):
	n = int(input())
	a = []
	for i in range(n):
		a.append(i + 1)
	print(*a, sep=' ')


T = int(input())
for case in range(T):
	n = int(input())
	ans_list = []
	for i in range(1, n + 1):
		ans_list.append(str(i))
	print(' '.join(ans_list))


from sys import stdin
for _ in range(int(stdin.readline())):
	print(*list(range(1, int(stdin.readline()) + 1)))


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	l = []
	for i in range(1, n + 1):
		l.append(i)
	print(*l)


import math
for i in range(int(input())):
	n = int(input())
	a = list()
	b = list()
	k = math.ceil(n / 2)
	for i in range(1, k + 1):
		a.append(i)
	for i in range(k + 1, n + 1):
		b.append(i)
	b.sort(reverse=True)
	k = 0
	j = 0
	for i in range(n):
		if i % 2 == 1:
			print(b[j], end=' ')
			j += 1
		elif i % 2 == 0:
			print(a[k], end=' ')
			k += 1
	print()


n = int(input())
for i in range(1, n + 1):
	nn = int(input())
	for k in range(nn, 0, -1):
		print(k, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	for n in range(1, n + 1):
		print(n, end=' ')


import sys
input = sys.stdin.readline
t = int(input())
for tests in range(t):
	n = int(input())
	print(*list(range(n, 0, -1)))


for test in range(int(input())):
	n = int(input())
	l = range(1, n + 1)
	print(*l)


import sys
input = sys.stdin.buffer.readline
from collections import deque as que, defaultdict as vector, Counter
from bisect import bisect as bsearch
from heapq import *
inin = lambda : int(input())
inar = lambda : list(map(int, input().split()))
inst = lambda : input().decode().rstrip('\n\r')
INF = float('inf')
_T_ = inin()
for _t_ in range(_T_):
	n = inin()
	a = [i + 1 for i in range(n)]
	print(*a)


for _ in range(int(input())):
	n = int(input())
	a = [i for i in range(n, 0, -1)]
	for i in range(n):
		x = a[i]
		j = i
		for j in range(i + 1, n):
			x = x | a[i]
		if x < j - i + 1:
			ans = False
	print(*a)


import sys
import math, bisect
from collections import defaultdict
from itertools import groupby, accumulate
from heapq import heapify, heappop, heappush
from collections import deque, Counter, OrderedDict
neo: lambda : map(int, input().split())
Neo: lambda : list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	A = list(range(1, n + 1))
	print(*A)


try:
	tst = int(input())
	for _ in range(tst):
		n = int(input())
		for i in range(1, n + 1):
			print(i, end=' ')
		print()
except:
	pass


import math, sys
from collections import defaultdict, Counter, deque
INF = float('inf')
MOD = 1000000007

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a

def isPrime(n):
	if n <= 1:
		return False
	i = 2
	while i ** 2 <= n:
		if n % i == 0:
			return False
		i += 1
	return True

def primeFactors(n):
	factors = []
	i = 2
	while i ** 2 <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def vars():
	return map(int, input().split())

def array():
	return list(map(int, input().split()))

def bs(arr, num):
	l = 0
	r = len(arr)
	while l <= r:
		m = (l + r) // 2
		if arr[m] >= num:
			r = m - 1
		else:
			l = m + 1
	return l

def main():
	n = int(input())
	ans = [i for i in range(n, 0, -1)]
	print(*ans)
t = int(input())
for _ in range(t):
	main()


from sys import stdin, stdout
from collections import Counter, OrderedDict
import math
cin = stdin.readline
cout = stdout.write
mp = lambda : list(map(int, cin().split()))

def chars():
	s = cin()
	return list(s[:len(s) - 1])

def pl(a):
	for val in a:
		cout(str(val) + ' ')
	cout('\n')
(t,) = mp()
for _ in range(t):
	(n,) = mp()
	for i in range(n):
		cout(str(i + 1) + ' ')
	cout('\n')


for _ in range(int(input())):
	n = int(input())
	s = ''
	for i in range(n):
		s += f'{i + 1} '
	print(s)


import bisect
import sys
import math
input = sys.stdin.readline
import functools
from collections import defaultdict

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve(case):
	n = inp()
	res = [str(i) for i in range(n, 0, -1)]
	return ' '.join(res)
if len(sys.argv) > 1 and sys.argv[1].startswith('input'):
	f = open('./' + sys.argv[1], 'r')
	input = f.readline
T = inp()
for i in range(T):
	res = solve(i + 1)
	print(str(res))


for i in range(int(input())):
	n = int(input())
	arr = map(str, range(1, n + 1))
	print(' '.join(arr))


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ans = list(range(1, n + 1))
	print(*ans)


n_test = int(input())
for i in range(n_test):
	n = int(input())
	output = [j for j in range(1, n + 1)]
	for j in output:
		print(j, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	while n > 0:
		print(n, end=' ')
		n -= 1
	print()


import sys
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

def inIList():
	return list(map(int, input().split()))

def inSList():
	return input().split()

def solve(n):
	for x in list(range(1, n + 1)):
		print(x, end=' ')
	print()
tests = inInt()
for case in range(tests):
	n = inInt()
	solve(n)


t = int(input())
while t:
	n = int(input())
	for x in range(1, n + 1):
		print(x, end=' ')
	print()
	t -= 1


import random

def solve():
	n = int(input())
	res = []
	for i in range(1, n + 1):
		res.append(i)
	random.shuffle(res)
	print(*res)
t = int(input())
while t:
	solve()
	t -= 1


import sys

def main():
	tn = int(sys.stdin.readline())
	for ti in range(tn):
		nn = int(sys.stdin.readline())
		print(' '.join(map(str, range(1, nn + 1))))
main()


import math
import os
import random
import re
import string
from sys import *
from collections import *

def bs(arr, x, l, r):
	if l <= r:
		mid = (r + l) // 2
		if arr[mid] == x:
			return mid
		elif arr[mid] > x:
			return bs(arr, x, l, mid - 1)
		else:
			return bs(arr, x, mid + 1, r)
	else:
		return -1

def solve():
	for _ in range(int(stdin.readline())):
		n = int(input())
		l = [n - i for i in range(n)]
		print(*l)
solve()


import sys
read = lambda : sys.stdin.readline().strip()
for _ in range(int(read())):
	for i in range(int(read())):
		print(i + 1, end=' ')
	print()


def rn():
	a = int(input())
	return a

def rl():
	a = list(map(int, input().split()))
	return a
for _ in range(rn()):
	a = rn()
	k = 1
	for i in range(a // 2):
		print(k, end=' ')
		print(a - k + 1, end=' ')
		k += 1
	if a % 2 == 1:
		print(a // 2 + 1, end=' ')
	print('')


def next_int():
	return int(input())

def next_ints():
	return [int(x) for x in input().split()]
t = next_int()
for i in range(0, t):
	p = next_int()
	for i in range(1, p + 1):
		print(i, end=' ')
	print()


import sys
from math import sqrt, gcd, ceil, log, floor
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def f(n):
	return pow(2, n, MOD) - 1

def f2(n, i):
	ans = 0
	for j in range(1, i + 1):
		ans += ncr(n, j, MOD)
	return ans

def main():
	ans_ = []
	for _ in range(int(input())):
		n = int(input())
		ans_.append(' '.join(map(str, [i for i in range(1, n + 1)])))
	print('\n'.join(ans_))
main()


for _ in range(int(input())):
	n = int(input())
	l = list(range(1, n + 1))
	l1 = []
	a = n // 2
	if n % 2 == 1:
		a += 1
	for i in range(a):
		l1.append(l[n // 2 + i])
		l1.append(l[n // 2 - i - 1])
	if n % 2 == 1:
		l1.remove(max(l1))
	print(' '.join(map(str, l1)))


import sys
from math import sqrt
from collections import OrderedDict
inpt = sys.stdin.readline

def inp():
	return int(inpt())

def inlist():
	return list(map(int, inpt().split()))

def instr():
	s = inpt()
	return list(s[:len(s) - 1])

def invr():
	return map(int, inpt().split())

def main():
	t = inp()
	for l in range(t):
		n = inp()
		for i in range(n, 0, -1):
			print(i, end=' ')
		print()
main()


n = int(input())
for t in range(n):
	a = int(input())
	lis = range(1, a + 1)
	print(*lis)


T = int(input())
for t in range(T):
	n = int(input())
	for num in range(1, n + 1):
		print(num)


def maink():
	n = int(input())
	a = ''
	for j in range(1, n + 1):
		a += str(j)
		a += ' '
	return a
t = int(input())
c = []
for i in range(t):
	c.append(maink())
for k in c:
	print(k)


import sys
import math
from functools import reduce
import bisect

def getN():
	return int(input())

def getNM():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def input():
	return sys.stdin.readline().rstrip()

def index(a, x):
	i = bisect.bisect_left(a, x)
	if i != len(a) and a[i] == x:
		return i
	return False
for i in range(int(input())):
	n = getN()
	print(*[x for x in range(1, n + 1)])


import sys
import math
import itertools
import functools
import collections
import operator
import fileinput
import copy
ORDA = 97

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return [int(i) for i in input().split()]

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def revn(n):
	return str(n)[::-1]

def dd():
	return collections.defaultdict(int)

def ddl():
	return collections.defaultdict(list)

def sieve(n):
	if n < 2:
		return list()
	prime = [True for _ in range(n + 1)]
	p = 3
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 2
	r = [2]
	for p in range(3, n + 1, 2):
		if prime[p]:
			r.append(p)
	return r

def divs(n, start=2):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def divn(n, primes):
	divs_number = 1
	for i in primes:
		if n == 1:
			return divs_number
		t = 1
		while n % i == 0:
			t += 1
			n //= i
		divs_number *= t

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base):
	new_number = 0
	while number > 0:
		new_number += number % base
		number //= base
	return new_number

def cdiv(n, k):
	return n // k + (n % k != 0)

def ispal(s):
	for i in range(len(s) // 2 + 1):
		if s[i] != s[-i - 1]:
			return False
	return True
for _ in range(ii()):
	print(*[i for i in range(1, ii() + 1)])


import math
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192
sys.setrecursionlimit(300000)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
for ik in range(int(input())):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	print(*l)


t = int(input())
while t:
	t -= 1
	x = int(input())
	a = x // 2 + x % 2
	p = []
	b = a - 1
	while a <= x:
		p.append(a)
		a += 1
		if b != 0:
			p.append(b)
			b -= 1
	for i in p:
		print(i, end=' ')
	print()


n = int(input())
i = 0
j = 0
k = 0
a = []
for i in range(0, n):
	y = int(input())
	a.append(y)
for k in a:
	if k == 0:
		print('0')
	for j in range(0, k):
		m = j + 1
		print(m, sep=' ')


case = int(input())
for caseNum in range(0, case):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


a = int(input())
lst = []
for num in range(0, a):
	ele = int(input())
	lst.append(ele)
for ele in lst:
	for i in range(0, ele):
		print(i + 1, end=' ')
	print('\n')


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline
for ii in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for s in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
while t > 0:
	t = t - 1
	n = int(input())
	a = n // 2
	b = n - n // 2
	c = []
	for i in range(max(a, b)):
		c.append(n)
		n = n - 1
	j = 1
	l = 0
	for i in range(min(a, b)):
		c.insert(l, j)
		j += 1
		l += 2
	print(*c)


k = int(input())
for t in range(k):
	size = int(input())
	list = []
	for r in range(size, 0, -1):
		list.append(r)
	print(*list)


import sys, math
for i in range(int(input())):
	n = int(input())
	ans = []
	ans.append(n)
	for i in range(n - 1):
		ans.append(i + 1)
	print(*ans)


t = int(input())
ans = []
for _ in range(t):
	n = int(input())
	ans.append(range(1, n + 1)[::-1])
for ansi in ans:
	for i in ansi:
		print(i, end=' ')
	print()


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
mod = int(1000000000.0) + 7
for _ in range(iinput()):
	n = iinput()
	ans = [i for i in range(n, 0, -1)]
	print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	answer = []
	for j in range(n, 0, -1):
		answer.append(j)
	print(*answer)


for _ in range(int(input())):
	n = int(input())
	res = list(range(n, 0, -1))
	print(*res)


def main(case):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
t = int(input())
for i in range(t):
	main(i + 1)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	a = list(range(n, 0, -1))
	print(*a)


def b_n(i, j):
	if i > j:
		return
	m = i + (j - i) // 2
	print(m, end=' ')
	b_n(m + 1, j)
	b_n(i, m - 1)
t = int(input())
while t > 0:
	n = int(input())
	b_n(1, n)
	print()
	t -= 1


t = int(input())
arr = []
for _ in range(t):
	arr.append(int(input()))
for n in arr:
	for no in range(1, n + 1):
		print(no, end=' ')


for _ in range(int(input())):
	n = int(input())
	a = []
	c = n // 2
	k = 0
	l = 0
	for i in range(1, n + 1):
		if i % 2 != 0:
			k += 1
			a.append(c + k)
		else:
			a.append(c - l)
			l += 1
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	lst = list()
	for i in range(n):
		lst.append(i + 1)
	for x in lst:
		print(x, end='')
		if x < n:
			print(' ', end='')
	print()


import sys
input = sys.stdin.readline
T = int(input())

def judge(x):
	m = len(x)
	for i in range(m):
		for j in range(i, m):
			tmp = 0
			for k in range(i, j + 1):
				tmp = tmp | x[k]
			if tmp < j - i + 1:
				return False
	return True
for testcase in range(1, T + 1):
	print(*list(range(1, int(input()) + 1)))


import sys
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

def inIList():
	return list(map(int, input().split()))

def inSList():
	return input().split()
result = None

def isgood(l, n):
	for x in range(0, n):
		for y in range(x, n):
			c = 0
			for i in range(x, y + 1):
				c = c | l[i]
			if c < y - x + 1:
				return False
	return True

def swap(l, i, j):
	tmp = l[i]
	l[i] = l[j]
	l[j] = tmp

def permutation(l, n, i, hasgood):
	if len(hasgood) >= 1:
		return
	if i >= n:
		if isgood(l, n):
			hasgood.append(l)
		return
	for j in range(i, n):
		swap(l, i, j)
		permutation(l, n, i + 1, hasgood)
		swap(l, i, j)
t = inInt()
for i in range(t):
	n = inInt()
	x = [i + 1 for i in range(n)]
	hasgood = []
	permutation(x, n, 0, hasgood)
	out = ''
	for x in hasgood[0]:
		if out == '':
			out = out + str(x)
		else:
			out = out + ' ' + str(x)
	print(out)


for n in [*open(0)][1:]:
	print(*range(1, int(n) + 1))


for t in range(int(input())):
	n = int(input())
	print(' '.join((str(v + 1) for v in range(n))))


import sys
import math
from math import *
from collections import defaultdict, Counter
import os
from io import BytesIO, IOBase
from collections import deque
import bisect
from copy import deepcopy

def main():
	n = int(input())
	ar = [i + 1 for i in range(n)]
	print(*ar)
for i in range(int(input())):
	main()


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
t = int(input())
for tc in range(t):
	n = int(input())
	print(*[i + 1 for i in range(n)])


T = int(input())
for case in range(T):
	n = int(input())
	ans = list(map(str, range(1, n + 1)))
	print(' '.join(ans))


for t in range(int(input())):
	n = int(input())
	a = [x for x in range(n, 0, -1)]
	print(*a)


from collections import defaultdict
for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n, 0, -1):
		arr.append(i)
	print(*arr)


T = int(input())
while T > 0:
	n = int(input())
	res = []
	for i in range(1, n + 1):
		res.append(i)
	print(*res)
	T -= 1


t = int(input())
for _ in range(t):
	n = int(input())
	print(' '.join([str(x) for x in range(1, n + 1)]))


def ms(n):
	if n == 1:
		print(1, end=' ')
		return 0
	if n % 2:
		ms(n - 1)
		print(n, end=' ')
	else:
		print(n, end=' ')
		ms(n - 1)

def solve():
	n = int(input())
	ms(n)
	print()
for i in range(int(input())):
	solve()


t = int(input())
while t > 0:
	t -= 1
	n = int(input())
	print(*range(1, n + 1))


from sys import stdin, stdout
input = stdin.readline

def write(n, sep='\n'):
	stdout.write(str(n))
	stdout.write(sep)

def gil():
	return list(map(int, input().split()))
for _t in range(int(input())):
	n = int(input())
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	arr = []
	for j in range(n):
		arr.append(j + 1)
	print(' '.join((str(x) for x in arr)))


import sys
import math
import bisect
import heapq
from bisect import bisect_right
from sys import stdin, stdout

def get_ints_in_variables():
	return map(int, sys.stdin.readline().strip().split())

def get_int():
	return int(sys.stdin.readline())

def get_ints_in_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_list_of_list(n):
	return [list(map(int, sys.stdin.readline().strip().split())) for _ in range(n)]

def get_string():
	return sys.stdin.readline().strip()

def Solution(n):
	for i in range(n, 0, -1):
		print(i, end=' ')
	print()

def main():
	for _ in range(get_int()):
		Solution(get_int())
main()


import sys
import math

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def MI():
	return map(int, sys.stdin.readline().split())

def SI():
	return sys.stdin.readline().strip()
t = II()
for q in range(t):
	n = II()
	l = list(range(1, n + 1))
	l = l[:][::-1]
	print(*l)


n = int(input())
arr = []
for i in range(n):
	num = int(input())
	for i in range(num):
		arr.append(i + 1)
	print(*arr)
	arr = []


for _ in range(int(input())):
	n = int(input())
	dp = [0] * n
	count = 0
	for i in range(1, n, 2):
		dp[i] = n // 2 - count
		count += 1
	count = 1
	for i in range(0, n, 2):
		dp[i] = n // 2 + count
		count += 1
	for i in dp:
		print(i, end=' ')
	print()


T = int(input())
for z in range(T):
	N = int(input())
	for i in range(N):
		print(i + 1, end=' ')
	print()


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcdefghijklmnopqrstuvwxyz'
M = 1000000007

def value():
	return tuple(map(float, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
for _ in range(Int()):
	n = Int()
	a = [i for i in range(1, n + 1)]
	print(*a)


t = int(input())
for h in range(t):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input())
n_values = [int(input()) for i in range(t)]
for value in n_values:
	for i in range(1, value + 1):
		print(i, end=' ')
	print()


for i in range(int(input())):
	a = int(input())
	for j in range(a):
		print(j + 1, end=' ')
	print()


import sys
cases = int(input())
input = sys.stdin.readline
for x in range(cases):
	print(' '.join((str(n + 1) for n in range(int(input()[:-1])))))


t = int(input())
for p in range(t):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input(''))
for i in range(t):
	n = int(input(''))
	d = list(range(1, n + 1))
	d = map(str, d)
	print(' '.join(d))


def solution(n):
	return [i + 1 for i in range(n)]

def main():
	for test in range(int(input())):
		n = int(input())
		result = solution(n)
		print(*result)
main()


import sys
input = sys.stdin.readline
R = lambda : list(map(int, input().split()))
(t,) = R()
for tc in range(t):
	(n,) = R()
	print(*[i + 1 for i in range(n)])


for _ in range(int(input())):
	n = int(input())
	lst = [i for i in range(1, n + 1)]
	for ele in lst:
		print(ele, end=' ')
	print()


import math as mt

def tran(n):
	an = []
	for i in range(1, n + 1):
		an.append(i)
	return an
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	r = tran(n)
	ans.append(r)
for i in ans:
	print(*i)


def suborrays(n):
	a = list(range(1, n + 1))
	i = 0
	l = 0
	while l != n:
		print(a[i], end=' ')
		l += 1
		if i >= 0:
			i += 1
			i = -i
		else:
			i = abs(i)
	print()
	return
t = int(input())
array = []
for i in range(t):
	array.append(int(input()))
for x in array:
	suborrays(x)


t = int(input())
num = list()
for j in range(t):
	num.append(int(input()))
for j in range(t):
	new = [x for x in range(1, num[j] + 1)]
	for x in new:
		print(x, end=' ')
	print()


T = int(input())
for _ in range(T):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append(n - i)
	print(*ans)


def main():
	for _ in range(int(input())):
		print(*list(range(1, int(input()) + 1)))
main()


def main():
	n = int(input())
	arr = list(map(lambda x: x + 1, range(n)))
	p = 0
	while p != n // 2:
		print(arr[p], arr[n - p - 1], end=' ', sep=' ')
		p += 1
	if n % 2:
		print(arr[n // 2])
for _ in range(int(input())):
	main()


for test in range(0, int(input())):
	n = int(input())
	arr = []
	for i in range(1, n + 1, 2):
		arr.append(i)
	for j in range(2, n + 1, 2):
		arr.append(j)
	print(*arr)


import atexit
import io
import sys
from itertools import permutations
from collections import Counter
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
for case in range(int(input())):
	n = int(input())
	print(' '.join([str(x) for x in range(1, n + 1)]))


p = int(input())
while p > 0:
	p -= 1
	n = int(input())
	s = list(range(1, n + 1))
	y = list()
	y.append(s[0])
	z = s[0]
	s[0] = 0
	for x in range(0, n):
		for i in range(0, n):
			if s[i] | z >= 2 and s[i] > 0:
				y.append(s[i])
				z = s[i]
				s[i] = 0
				break
	print(*y)


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def solve():
	n = I()
	a = [i for i in range(1, n + 1)]
	print(*a)
for _ in range(I()):
	solve()


from collections import Counter
from math import ceil, gcd, log

def ans(n):
	ans = [i for i in range(1, n + 1)]
	ans = ans[::-1]
	for i in ans:
		print(i, end=' ')
	return
for _ in range(int(input())):
	n = int(input())
	ans(n)
	print()


t = int(input())
n = []
for i in range(0, t):
	x = int(input())
	n.append(x)
arr = []
for i in range(0, t):
	array = []
	for j in range(0, n[i]):
		ele = j + 1
		array.append(ele)
	arr.append(array)
from itertools import permutations
from itertools import combinations
for i in range(0, t):
	perm = permutations(arr[i])
	for p in perm:
		flag = 0
		for k in range(0, len(p)):
			for l in range(k, len(p)):
				if l != k:
					ans = p[k]
					for m in range(k, l):
						ans = ans | p[m + 1]
					if ans < k - l + 3:
						flag = 1
		if flag == 0:
			print(*p, sep=' ')
			break


from sys import stdin

def input():
	return stdin.readline().rstrip()
for i in range(int(input())):
	n = int(input())
	for _ in range(1, n + 1):
		print(_, end=' ')
	print()


for t in range(int(input())):
	print(*list(range(1, int(input()) + 1)))


import sys
for i in range(0, int(sys.stdin.readline())):
	k = [j for j in range(1, 1 + int(sys.stdin.readline()))]
	sys.stdout.write(' '.join(list(map(str, k))) + '\n')


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
t = int(input())
for _ in range(t):
	n = int(input())
	ans = [str(x) for x in range(n, 0, -1)]
	print(' '.join(ans))


for _ in range(int(input())):
	n = int(input())
	arr = []
	(flag, start, end) = (0, 1, n)
	for i in range(n):
		if i % 2 == 0:
			arr.append(end)
			end -= 1
		else:
			arr.append(start)
			start += 1
	print(*arr)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = ip()
for _ in range(t):
	n = ip()
	ans = [i for i in range(1, n + 1)]
	print(*ans)


import math
t = int(input())
for i in range(t):
	n = int(input().strip())
	arr = [0] * n
	r = n if n % 2 == 0 else n - 1
	num = 1
	while r >= 2:
		arr[r - 1] = num
		num += 1
		r -= 2
	l = r
	while l < n:
		arr[l] = num
		num += 1
		l += 2
	print(' '.join([str(x) for x in arr]))


import sys
import os.path
import functools
import itertools
import re

def solve():
	T = int(input())
	for test in range(0, T):
		n = int(input())
		for i in range(1, n + 1):
			print(i, end=' ')
		print()

def main():
	if os.path.exists('test.inp'):
		sys.stdin = open('test.inp', 'r')
	solve()
main()


import heapq as hq
from heapq import heappop, heappush
from collections import deque, defaultdict, Counter
import math

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def subset_sum_count(arr, n, sum):
	dp = [[0 for _ in range(sum + 1)] for _ in range(n + 1)]
	for i in range(n + 1):
		for j in range(sum + 1):
			if j == 0:
				dp[i][j] = 1
			elif arr[i - 1] <= j:
				dp[i][j] = dp[i - 1][j - arr[i - 1]] + dp[i - 1][j]
			else:
				dp[i][j] = dp[i - 1][j]
	return dp[n][sum]

def prefix(a):
	pre = []
	pre.append(a[0])
	for i in range(1, len(a)):
		pre.append(pre[i - 1] + a[i])
	return pre

def binary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		mi = lo + (hi - lo) / 2
		if func(mi):
			hi = mi
		else:
			lo = mi
	return (lo + hi) / 2

def ternary_search(func, lo, hi, abs_prec=1e-07):
	while abs(hi - lo) > abs_prec:
		lo_third = lo + (hi - lo) / 3
		hi_third = hi - (hi - lo) / 3
		if func(lo_third) < func(hi_third):
			lo = lo_third
		else:
			hi = hi_third
	return (lo + hi) / 2

def discrete_binary_search(func, lo, hi):
	while lo < hi:
		mi = lo + (hi - lo) // 2
		if func(mi):
			hi = mi
		else:
			lo = mi + 1
	return lo

def discrete_ternary_search(func, lo, hi):
	while lo <= hi:
		lo_third = lo + (hi - lo) // 3
		hi_third = lo + (hi - lo) // 3 + (1 if 0 < hi - lo < 3 else (hi - lo) // 3)
		if func(lo_third) < func(hi_third):
			lo = lo_third + 1
		else:
			hi = hi_third - 1
	return lo
	return -1

def right_rotate(a, s):
	return a[s:] + a[:s]

def dec_to_bin(x):
	return int(bin(x)[2:])

def str_to_integer_list(n):
	a = []
	for i in range(len(n)):
		a.append(int(n[i]))
	return a

def list_to_str(l):
	s = ''
	for i in l:
		s += str(i)
	return s

def dijkstra(s, N, E):
	visited = set()
	dist = {}
	for i in range(1, N + 1):
		dist[i] = 1 << 29
	queue = [(dist[i], i) for i in range(1, N + 1)]
	hq.heappush(queue, (0, s))
	dist[s] = 0
	while queue:
		(d, u) = hq.heappop(queue)
		if u in visited:
			continue
		for t in E[u]:
			(v, r) = t
			if dist[v] > d + r:
				dist[v] = d + r
				hq.heappush(queue, (dist[v], v))
		visited.add(u)
	return dist

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def dijkstra(n, graph, start):
	(dist, parents) = ([float('inf')] * n, [-1] * n)
	dist[start] = 0
	queue = [(0, start)]
	while queue:
		(path_len, v) = heappop(queue)
		if path_len == dist[v]:
			for (w, edge_len) in graph[v]:
				if edge_len + path_len < dist[w]:
					(dist[w], parents[w]) = (edge_len + path_len, v)
					heappush(queue, (edge_len + path_len, w))
	return (dist, parents)

def path(start, end, parent):
	path = [end]
	while path[-1] != start:
		path.append(parent[path[-1]])
	path.reverse()
	return path

def isPrime(number):
	if number != 2:
		if number < 2 or number % 2 == 0:
			return False
		i = 3
		while i * i <= number:
			if number % i == 0:
				return False
			i += 2
	return True

def bfs(graph, start, goal):
	if start == goal:
		return [start]
	visited = {start}
	queue = deque([(start, [])])
	while queue:
		(current, path) = queue.popleft()
		visited.add(current)
		for neighbor in graph[current]:
			if neighbor == goal:
				return path + [current, neighbor]
			if neighbor in visited:
				continue
			queue.append((neighbor, path + [current]))
			visited.add(neighbor)
	return None
import os
import sys
from io import BytesIO, IOBase

def main():
	for _ in range(inp()):
		n = inp()
		res = []
		for i in range(1, n + 1):
			res.append(i)
		print(*res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for _ in range(int(input())):
	n = int(input())
	l = list(range(1, n + 1))
	l.reverse()
	s = ''
	for i in l:
		s = s + str(i) + ' '
	print(s)


for i in range(int(input())):
	n = int(input())
	a = [0] * n
	p = (n + 1) // 2
	m = (n + 1) // 2
	m -= 1
	for j in range(n):
		if j % 2 == 0:
			a[j] = p
			p += 1
		else:
			a[j] = m
			m -= 1
	if n % 2 == 0:
		a[-1] = n
	print(*a)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
for _ in range(ri()):
	for i in range(1, ri() + 1):
		print(i, end=' ')
	print()


m = int(input())
for i in range(m):
	listt = []
	n = int(input())
	if n == 1:
		print(1)
	elif n > 1 and n % 2 != 0:
		for i in range(1, n // 2 + 1):
			listt.append(str(i))
			listt.append(str(n - i))
		listt.append(str(n))
	elif n > 1 and n % 2 == 0:
		for i in range(1, n // 2 + 1):
			listt.append(str(i))
			listt.append(str(n - i + 1))
	print(' '.join(listt))


def check(ans):
	for i in range(len(ans)):
		v = ans[i]
		for j in range(i + 1, len(ans)):
			v |= ans[j]
			assert v >= j - i + 1

def solve(n):
	return list(range(1, n + 1))
for _ in range(int(input())):
	n = int(input())
	print(*solve(n))


tcs = int(input())
for tc in range(tcs):
	l = int(input())
	i = 1
	j = l
	r = []
	while i <= j:
		if i != j:
			r.append(str(i))
		r.append(str(j))
		i += 1
		j -= 1
	print(' '.join(r))


def solve():
	n = int(input())
	l = []
	for i in range(n):
		l.append(i + 1)
	print(*l)
for _ in range(int(input())):
	solve()


def please():
	N = int(input())
	for i in range(N):
		a = int(input())
		for j in range(1, a + 1, 1):
			if j == a:
				print(j)
			else:
				print(j, end=' ')
please()


for _ in range(int(input())):
	l = []
	for i in range(1, int(input()) + 1):
		l.append(i)
	b = l[::-1]
	for item in b:
		print(item, end=' ')


t = int(input())
for p in range(t):
	n = int(input())
	print(*list(range(1, n + 1)))


def mySolver(length):
	for i in range(1, length + 1):
		print(i, end=' ')

def main():
	case = int(input())
	for i in range(0, case):
		each_len = int(input())
		mySolver(each_len)
main()


t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n, 0, -1):
		print(i, sep=' ', end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	l = l[::-1]
	for j in l:
		print(j, end=' ')
	print()


t = int(input())
for i in range(0, t):
	n = int(input())
	li = ''
	for j in range(1, n + 1):
		li = li + str(j) + ' '
	print(li)


t = int(input())
for _ in range(t):
	n = int(input())
	if n == 1:
		print(1)
	else:
		ans = [n]
		for i in range(1, n):
			ans.append(i)
		print(*ans)


x = int(input())
for _ in range(x):
	y = int(input())
	c = ''
	for j in range(1, y + 1):
		c += str(j) + ' '
	print(c)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	N = int(input())
	print(*[x for x in range(1, N + 1)])


t = int(input())
while t:
	n = int(input())
	li = []
	for i in range(1, n + 1):
		li.append(i)
	for i in li:
		print(i, end=' ')
	t -= 1


for i in range(int(input())):
	n = int(input())
	l = [int(k) for k in range(n + 1)]
	for j in range(n, 0, -1):
		print(j, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	ans = [0] * n
	if n == 1:
		print(1)
	else:
		d = n // 2 + 1
		dd = n // 2 + 1
		for i in range(n):
			if i == 0:
				print(d, end=' ')
			elif i % 2 == 1:
				dd -= 1
				print(dd, end=' ')
			elif i % 2 == 0:
				d += 1
				print(d, end=' ')
		print()


def solve(n, ans):
	arr = []
	for i in range(n):
		arr.append(str(i + 1))
	ans.append(arr)

def main():
	t = int(input())
	ans = []
	for i in range(t):
		n = int(input())
		solve(n, ans)
	for i in ans:
		print(' '.join(i))
main()


from itertools import combinations
for _ in range(int(input())):
	n = int(input())
	it = [str(i) for i in range(1, n + 1)]
	it.sort(reverse=True)
	print(' '.join(it))


from collections import *
import sys

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))
t = ri()
for _ in range(t):
	n = ri()
	print(*list(range(1, n + 1)))


for tt in range(int(input())):
	n = int(input())
	ans = [i for i in range(1, n + 1)]
	print(*ans)


from sys import stdin, stdout
import heapq as hq
from collections import defaultdict
t = int(input())
for tc in range(t):
	n = int(stdin.readline())
	res1 = []
	res2 = []
	res = []
	for i in range(n):
		if i % 2 == 0:
			res1.append(i + 1)
		else:
			res2.append(i + 1)
	res1 = res1[::-1]
	for i in range(n // 2):
		res.append(res2[i])
		res.append(res1[i])
	if n % 2 == 1:
		res.append(res1[-1])
	res_s = ' '.join([str(x) for x in res])
	stdout.write(str(res_s) + '\n')


for test_i in range(int(input())):
	n = int(input())
	print(*[i for i in range(1, n + 1)])


import math
import sys
import bisect
input = sys.stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


def find_permutation(n):
	return [i for i in range(1, n + 1)]

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(*find_permutation(n))
main()


T = int(input())
for test in range(T):
	n = int(input())
	print(' '.join([str(x) for x in range(1, n + 1)]))


for i in range(int(input())):
	n = int(input())
	start = []
	i = 0
	while 2 ** i <= n:
		start.append(2 ** i)
		i += 1
	permutation = list(range(1, n + 1))
	leftovers = list(set(permutation) - set(start))
	answer = start + leftovers
	print(' '.join([str(i) for i in answer]))


for i in range(int(input())):
	n = int(input())
	for k in range(n):
		print(k + 1, end=' ')
	print()


n = int(input())
for i in range(n):
	m = int(input())
	for j in range(1, m + 1, 2):
		print(j, end=' ')
	for j in range(2, m + 1, 2):
		print(j, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	lst = [0]
	for i in range(1, n + 1):
		lst.append(i)
	res = []
	if n % 2:
		mid = lst[n // 2 + 1]
		for i in range(1, n // 2 + 1):
			res.append(lst[i])
			res.append(lst[-i])
		res.append(mid)
	else:
		for i in range(1, n // 2 + 1):
			res.append(lst[i])
			res.append(lst[-i])
	print(*res)


from collections import defaultdict
import itertools
import statistics
t = int(input())
for _ in range(t):
	n = int(input())
	x = []
	for i in range(1, n + 1):
		x.append(str(i))
	print(' '.join(x))


from __future__ import division, print_function
import sys
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
import os, sys, bisect, copy
from collections import defaultdict, Counter, deque
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
if os.path.exists('out.txt'):
	sys.stdout = open('out.txt', 'w')

def input():
	return sys.stdin.readline()

def mapi(arg=0):
	return map(int if arg == 0 else str, input().split())
for _ in range(int(input())):
	n = int(input())
	res = [i for i in range(1, n + 1)]
	print(*res)


from itertools import permutations

def good(permutation):
	or_map = {}
	size = len(permutation)
	if size == 1:
		return True
	gap = 0
	while gap < size:
		for i in range(0, size - gap):
			j = i + gap
			if gap == 0:
				or_map[i, j] = permutation[i]
			else:
				or_map[i, j] = or_map[i, j - 1] | or_map[j, j]
				if or_map[i, j] < j - i + 1:
					return False
		gap += 1
	return True

def solve(n):
	for permutation in permutations(range(1, n + 1)):
		if good(permutation):
			print(*permutation, sep=' ')
			return
	return

def main():
	t = int(input().strip())
	for case in range(t):
		n = int(input().strip())
		solve(n)
	return
main()


import random
for testcase in range(int(input())):
	n = int(input())
	permutation = list(range(1, n + 1))
	random.shuffle(permutation)
	print(*permutation)


from functools import lru_cache
from sys import stdin, stdout
import sys
for __ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


for i in range(int(input())):
	lista = []
	for j in range(1, int(input()) + 1):
		lista.append(j)
	print(*lista)


for _ in range(int(input())):
	n = int(input())
	arr = []
	arr2 = []
	for i in range(n, n // 2, -1):
		arr.append(i)
	for i in range(1, n // 2 + 1):
		arr2.append(i)
	j = 0
	k = 0
	ans = []
	for i in range(n):
		if i % 2 == 0:
			ans.append(str(arr[j]))
			j += 1
		else:
			ans.append(str(arr2[k]))
			k += 1
	print(' '.join(ans))


import sys
from decimal import Decimal
import math
from collections import Counter
import bisect
from itertools import combinations
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 6 + 7
INF = 10 ** 9
PI = 3.141592653589793

def lcm(a: int, b: int) -> int:
	return a * b // math.gcd(a, b)

def Main():
	for _ in range(int(input())):
		n = int(input())
		print(*range(1, n + 1))
Main()


import os
import heapq
import sys, threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10 ** 5)
from io import BytesIO, IOBase

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

def power(x, p, m):
	res = 1
	while p:
		if p & 1:
			res = res * x % m
		x = x * x % m
		p >>= 1
	return res

def inar():
	return [int(k) for k in input().split()]

def lcm(num1, num2):
	return num1 * num2 // gcd(num1, num2)

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		res = []
		for i in range(1, n + 1):
			res.append(i)
		print(*res)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for k in range(int(input())):
	n = int(input())
	f = [j for j in range(1, n + 1)]
	print(*f)


x = int(input())
while x > 0:
	n = int(input())
	a = [i + 1 for i in range(n)]
	for num in a:
		print(num, end=' ')
	print()
	x -= 1


t = int(input())
for i in range(0, t):
	m = int(input())
	l = []
	for i in range(m, 0, -1):
		l.append(i)
	print(*l, sep=' ')


for _ in range(int(input())):
	n = int(input())
	lis = []
	for x in range(n, 0, -1):
		print(x, end=' ')


for _ in range(int(input())):
	n = int(input())
	(i, j) = (n // 2, n // 2 + 1)
	while j <= n and i > 0:
		print(j, i, end=' ')
		j += 1
		i -= 1
	if n % 2 != 0:
		print(n)
	else:
		print()


for _ in ' ' * int(input()):
	n = int(input())
	(*ans,) = range(1, n + 1)
	print(*ans)


test = int(input())
for _ in range(test):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


import sys
input = sys.stdin.readline
t = int(input())
A = [int(input()) for i in range(t)]
for i in range(t):
	print(*[i + 1 for i in range(A[i])])


import sys
import os.path
if os.path.exists('in.txt'):
	sys.stdin = open('in.txt', 'r')
for _ in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
for h in range(t):
	n = int(input())
	a = list(range(1, n + 1))
	print(*a)


ll = lambda : list(map(int, input().split()))
lls = lambda : list(map(str, input().split()))
st = lambda : input()
v = lambda : map(int, input().split())
ii = lambda : int(input())
from math import *
from datetime import datetime
from sys import stdin, stdout

def lcm(a, b):
	return a * b // gcd(a, b)
from collections import *
for _ in range(ii()):
	x = ii()
	l = [i for i in range(1, x + 1)]
	print(*l)


import io
import os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())
t = oint()
for _ in range(t):
	n = oint()
	ans = [i for i in range(1, n + 1)]
	print(*ans)


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s)
	sys.stdout.write('\n')

def wi(n):
	sys.stdout.write(str(n))
	sys.stdout.write('\n')

def wia(a, sep=' '):
	sys.stdout.write(sep.join([str(x) for x in a]))
	sys.stdout.write('\n')

def test(n, a):
	for i in range(n):
		for j in range(i, n):
			cnt = 0
			for k in range(i, j + 1):
				cnt |= a[k]
			if cnt < j - i + 1:
				return False
	return True
from itertools import permutations

def solve(n):
	wia([i + 1 for i in range(n)])
	return
	ws('================')
	wi(n)
	for p in permutations(a):
		b = list(p)
		if test(n, b):
			wia(b)

def main():
	for _ in range(ri()):
		n = ri()
		solve(n)
main()


import sys
import math
import copy
import heapq
from fractions import *
from decimal import *
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
input = sys.stdin.readline
getS = lambda : input().strip()
getN = lambda : int(input())
getList = lambda : list(map(int, input().split()))
getZList = lambda : [int(x) - 1 for x in input().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
divide = lambda x: pow(x, MOD - 2, MOD)

def nck(n, k, kaijyo):
	return npk(n, k, kaijyo) * divide(kaijyo[k]) % MOD

def npk(n, k, kaijyo):
	if k == 0 or k == n:
		return n % MOD
	return kaijyo[n] * divide(kaijyo[n - k]) % MOD

def fact_and_inv(SIZE):
	inv = [0] * SIZE
	fac = [0] * SIZE
	finv = [0] * SIZE
	inv[1] = 1
	fac[0] = fac[1] = 1
	finv[0] = finv[1] = 1
	for i in range(2, SIZE):
		inv[i] = MOD - MOD // i * inv[MOD % i] % MOD
		fac[i] = fac[i - 1] * i % MOD
		finv[i] = finv[i - 1] * inv[i] % MOD
	return (fac, finv)

def renritsu(A, Y):
	A = np.matrix(A)
	Y = np.matrix(Y)
	Y = np.reshape(Y, (-1, 1))
	X = np.linalg.solve(A, Y)
	return X.flatten().tolist()[0]

class TwoDimGrid:

	def __init__(self, h, w, wall='#'):
		self.h = h
		self.w = w
		self.size = (h + 2) * (w + 2)
		self.wall = wall
		self.get_grid()

	def get_grid(self):
		grid = [self.wall * (self.w + 2)]
		for i in range(self.h):
			grid.append(self.wall + getS() + self.wall)
		grid.append(self.wall * (self.w + 2))
		self.grid = grid

	def init_cost(self):
		self.cost = [INF] * self.size

	def pos(self, x, y):
		return y * (self.w + 2) + x

	def getgrid(self, x, y):
		return self.grid[y][x]

	def get(self, x, y):
		return self.cost[self.pos(x, y)]

	def set(self, x, y, v):
		self.cost[self.pos(x, y)] = v
		return

	def show(self):
		for i in range(self.h + 2):
			print(self.cost[(self.w + 2) * i:(self.w + 2) * (i + 1)])

	def showsome(self, tgt):
		for t in tgt:
			print(t)
		return

	def showsomejoin(self, tgt):
		for t in tgt:
			print(''.join(t))
		return

	def search(self):
		grid = self.grid
		move = [(0, 1), (0, -1), (1, 0), (-1, 0)]
		move_eight = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]

def solve():
	n = getN()
	lis = [i + 1 for i in range(n)]
	print(*lis)

def main():
	n = getN()
	for _ in range(n):
		solve()
	return
main()


t = int(input())
for case in range(1, t + 1):
	n = int(input())
	print(' '.join(list(map(str, range(1, n + 1)))))


t = int(input())
for _ in range(t):
	n = int(input())
	lst = [0] * n
	for i in range(0, len(lst), 2):
		lst[i] = n
		n -= 1
	for i in range(1, len(lst), 2):
		lst[i] = n
		n -= 1
	for i in range(len(lst)):
		if i == len(lst) - 1:
			print(lst[i])
		else:
			print(lst[i], end=' ')


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	x = [x for x in range(1, n + 1)]
	print(*x)


import sys
import collections

def input():
	return sys.stdin.readline().rstrip()

def split_input():
	return [int(i) for i in input().split()]
tests = int(input())
for _ in range(tests):
	n = int(input())
	ans = []
	for i in range(n, 0, -1):
		ans.append(i)
	print(*ans, sep=' ')


for _ in range(int(input())):
	n = int(input())
	a = [0] * n
	k = 1
	for i in range(0, n, 2):
		a[i] = k
		k += 1
	for j in range(1, n, 2):
		a[j] = k
		k += 1
	for i in a:
		print(i, end=' ')
	print()


t = int(input())
while t:
	n = int(input())
	for j in range(n):
		if j != n - 1:
			print(j + 1, end=' ')
		else:
			print(j + 1)
	t -= 1


for _ in range(int(input())):
	n = int(input())
	print(*[x for x in range(n, 0, -1)])


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	for i in range(n):
		print(n - i, end=' ')
	print()


def sol():
	n = int(input())
	return ' '.join(map(str, list(range(1, n + 1))))

def main():
	T = int(input())
	for t in range(T):
		res = sol()
		print(res)
main()


from sys import stdin, setrecursionlimit, stdout
from collections import deque
from math import sqrt, floor, ceil, log, log2, log10, pi, gcd, sin, cos, asin
from heapq import heapify, heappop, heappush, heapreplace, heappushpop
from bisect import bisect_right, bisect_left

def ii():
	return int(stdin.readline())

def fi():
	return float(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def fmi():
	return map(float, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline().rstrip()

def lsi():
	return list(si())
mod = 1000000007
res = ['NO', 'YES']
(test, test_case) = (0, 1)
test_case = ii()
while test < test_case:
	test += 1
	n = ii()
	print(*[i + 1 for i in range(n)])


from sys import stdin, stdout
from math import gcd
import math
from collections import defaultdict
input = stdin.readline
print = stdout.write
for i in range(int(input())):
	n = int(input())
	l = list(range(1, n + 1))
	for i in l:
		print(str(i) + ' ')
	print('\n')


def solve(res):
	j = 0
	while j < n - 1:
		(res[j], res[j + 1]) = (res[j + 1], res[j])
		j += 2
	for x in res:
		print(x, end=' ')
	print()
t = int(input())
for i in range(t):
	n = int(input())
	res = [i + 1 for i in range(n)]
	solve(res)


for u in range(int(input())):
	n = int(input())
	x = [i for i in range(1, n + 1)]
	print(*x)


def good_array(n):
	arr = []
	for i in range(n, n // 2, -1):
		arr.append(i)
		if n - i + 1 > 0:
			arr.append(n - i + 1)
	return arr[::-1] if n % 2 == 0 else arr[::-1][1:]
for _ in range(int(input())):
	n = int(input())
	print(' '.join(map(str, good_array(n))))


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	d = []
	for i in range(0, n):
		d.append(n - i)
	ans.append(d)
for i in ans:
	print(*i)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
for _ in range(L()[0]):
	n = L()[0]
	print(*[i + 1 for i in range(n)])


import sys
import math
from collections import defaultdict as ddict
fast_inp = lambda : sys.stdin.readline().split('\n')[0]
read_list = lambda : fast_inp().split(' ')
read_listi = lambda : list(map(int, fast_inp().split(' ')))
read_listf = lambda : list(map(float, fast_inp().split(' ')))
read_int = lambda : int(fast_inp())
read_float = lambda : float(fast_inp())
read = lambda : fast_inp()
DEBUG = False

def debug(**kwargs):
	if not DEBUG:
		return
	print('*' * 20)
	for (k, v) in kwargs.items():
		print(f'\t{k}:{v}\t')
	print('*' * 20)

def solve() -> None:
	n = read_int()
	arr = []
	for i in range(n):
		arr.append(i + 1)
	print(*arr[::-1])
t = read_int()
for _ in range(t):
	solve()


def ans(a):
	i = a
	while i > 0:
		print(i, end=' ')
		i -= 1
	print()
t = int(input())
while t > 0:
	a = int(input())
	ans(a)
	t -= 1


def search(x):
	l = []
	for i in range(1, x + 1):
		l.append(i)
	print(*l, sep=' ')
t = int(input())
for i in range(t):
	x = int(input())
	search(x)


for testcases in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	m = int(input())
	a = []
	for j in range(1, m + 1):
		if j == m:
			print(j)
		else:
			print(j, end=' ')


t = int(input())
for _ in range(t):
	n = int(input())
	li = [i + 1 for i in range(n)]
	print(*li)


from itertools import permutations
for i in range(int(input())):
	x = int(input())
	b = [str(i) for i in range(1, x + 1)]
	z = ' '.join(b)
	print(z)


f = lambda : map(int, input().split())
for _ in range(int(input())):
	n = int(input())
	l = list(range(1, n + 1))
	print(*l)


T = int(input())
for _ in range(T):
	n = int(input())
	ans = []
	for i in range(n):
		ans.append('%d' % (i + 1))
	print(' '.join(ans))


x = int(input())
for i in range(x):
	y = int(input())
	l = []
	for j in range(1, y + 1):
		l.append(j)
	s = set(l)
	print(*s)


t = int(input().strip())
while t:
	n = int(input().strip())
	for p in range(1, n + 1):
		print(p, end=' ')
	print('')
	t -= 1


t = int(input())
while t:
	t -= 1
	n = int(input())
	p = [i for i in range(1, n + 1)]
	print(*p)


t = int(input())
for x in range(t):
	n = int(input())
	a = list(range(1, n + 1))
	for i in range(n):
		print(a[i], end=' ')


T = int(input())
while T > 0:
	N = int(input())
	for i in range(1, N + 1):
		print(i, end=' ')
	print()
	T -= 1


for x in range(int(input())):
	n = int(input())
	lst = list()
	for i in range(1, n + 1):
		lst.append(i)
	print(*lst)


import sys
input = sys.stdin.readline

def print(val):
	sys.stdout.write(str(val) + '\n')

def prog():
	for _ in range(int(input())):
		n = int(input())
		print(' '.join(map(str, [i + 1 for i in range(n)])))
prog()


import sys
input = sys.stdin.readline
ins = lambda : input()
ini = lambda : int(input())
inm = lambda : map(int, input().split())
inl = lambda : list(map(int, input().split()))
t = ini()
for _ in range(t):
	n = ini()
	print(*[i for i in range(n, 0, -1)])


import math
t = int(input())
for k in range(t):
	s = int(input())
	for i in range(1, s + 1):
		print(i, end=' ')
	print()


from collections import defaultdict as dd
from sys import stdin, stdout
for t in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		stdout.write(str(i) + ' ')
	stdout.write('\n')


from sys import stdin
n = int(stdin.readline().strip())
for i in range(n):
	x = int(stdin.readline().strip())
	ans = [i for i in range(1, x + 1)]
	print(*ans)


n = []
for _ in range(int(input())):
	n.append(int(input()))
for n in n:
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


from sys import *
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	for i in range(n, 0, -1):
		stdout.write(str(i) + ' ')
	print()


from math import *
sInt = lambda : int(input())
mInt = lambda : map(int, input().split())
lInt = lambda : list(map(int, input().split()))
t = sInt()
for i in range(t):
	n = sInt()
	a = [i for i in range(1, n + 1)]
	print(*a)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop, heapify
import math
from collections import *
from functools import reduce, cmp_to_key
import sys
input = sys.stdin.readline
from itertools import accumulate
M = mod = 998244353

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip('\n').split()]

def st():
	return input().rstrip('\n')

def val():
	return int(input().rstrip('\n'))

def li2():
	return [i for i in input().rstrip('\n')]

def li3():
	return [int(i) for i in input().rstrip('\n')]
for _ in range(val()):
	n = val()
	l = []
	print(*range(1, 1 + n))


t = int(input())
for q in range(0, t):
	n = int(input())
	if n == 1:
		print(1)
	else:
		a = [0] * n
		a[0] = 2
		a[1] = 1
		for i in range(2, n):
			a[i] = i + 1
		print(*a)


ncase = int(input())
for case in range(ncase):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())
sys.setrecursionlimit(1500)

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_right(a, x)
	if i != len(a):
		return i
	else:
		return -1

def main():
	try:
		n = I()
		ans = [x for x in range(n, 0, -1)]
		print(*ans)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(I()):
	main()


for i in range(int(input())):
	n = int(input())
	k = ''
	for i in range(1, n):
		k = k + str(i) + ' '
	k = k + str(n)
	print(k)


n = int(input())
l = []
for i in range(n):
	x = int(input())
	temp_list = []
	for i in range(1, x + 1):
		temp_list.append(i)
	l.append(temp_list)
for k in l:
	for j in k:
		print(j, end=' ')
	print()


for t in range(int(input())):
	no = int(input())
	i = 0
	if no == 1:
		print(1)
	elif no % 2 == 0:
		for i in range(1, no // 2 + 1):
			print(i, no - i + 1, end=' ')
	else:
		for i in range(1, no // 2 + 1):
			if i == no // 2:
				print(no // 2 + 1, end=' ')
			print(i, no - i + 1, end=' ')
	print()


for ii in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(i + 1)
	print(*a)


while True:
	try:
		t = eval(input())
		for i in range(t):
			n = eval(input())
			for j in range(1, n + 1):
				if j != n:
					print(j, end=' ')
				else:
					print(j, end='\n')
	except:
		break


n = int(input())
for i in range(n):
	a = int(input())
	s = ''
	for i in range(1, a + 1):
		s = s + str(i) + ' '
	print(s)


for t in range(int(input())):
	n = int(input())
	i = 1
	j = n
	out = ''
	if n == 1:
		out = '1'
	while i < j:
		out += ' ' + str(j) + ' ' + str(i)
		j -= 1
		i += 1
		if i == j:
			out += ' ' + str(i)
			break
	print(out)


import collections
from functools import lru_cache

def read():
	return input().strip()

def readInt():
	return int(input().strip())

def readList():
	return list(map(int, input().strip().split()))
t = readInt()
for i in range(t):
	n = readInt()
	print(' '.join(map(str, [i for i in range(1, n + 1)])))


T = int(input())
for _ in range(T):
	n = int(input())
	print(*range(1, n + 1))


from bisect import bisect_left, bisect_right
from itertools import combinations
from itertools import permutations
from bisect import bisect_left
from math import ceil
from math import radians
from heapq import heapify, heappush, heappop
import bisect
from math import pi
from collections import deque
from math import factorial
from math import log, ceil
from collections import defaultdict
from math import *
from sys import stdin, stdout
import itertools
import os
import sys
import threading
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import *
from fractions import Fraction
mod = int(pow(10, 9) + 7)

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li1():
	return list(mi())

def fii():
	return int(stdin.readline())

def fsi():
	return str(stdin.readline())

def fmi():
	return map(int, stdin.readline().split())

def fli():
	return list(fmi())
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph(e):
	d = {}
	for i in range(e):
		(x, y) = mi()
		if x not in d:
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d:
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = defaultdict(list)
	for i in range(n):
		(x, y) = mi()
		d[x].append(y)
	return d

def connected_components(graph):
	seen = set()

	def dfs(v):
		vs = set([v])
		component = []
		while vs:
			v = vs.pop()
			seen.add(v)
			vs |= set(graph[v]) - seen
			component.append(v)
		return component
	ans = []
	for v in graph:
		if v not in seen:
			d = dfs(v)
			ans.append(d)
	return ans

def primeFactors(n):
	s = set()
	while n % 2 == 0:
		s.add(2)
		n = n // 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0 and i % 2 == 1:
			s.add(i)
			n = n // i
	if n > 2 and n % 2 == 1:
		s.add(n)
	return s

def find_all(a_str, sub):
	start = 0
	while True:
		start = a_str.find(sub, start)
		if start == -1:
			return
		yield start
		start += len(sub)

def SieveOfEratosthenes(n, isPrime):
	isPrime[0] = isPrime[1] = False
	for i in range(2, n):
		isPrime[i] = True
	p = 2
	while p * p <= n:
		if isPrime[p] == True:
			i = p * p
			while i <= n:
				isPrime[i] = False
				i += p
		p += 1
	return isPrime

def dijkstra(edges, f, t):
	g = defaultdict(list)
	for (l, r, c) in edges:
		g[l].append((c, r))
	(q, seen, mins) = ([(0, f, ())], set(), {f: 0})
	while q:
		(cost, v1, path) = heappop(q)
		if v1 not in seen:
			seen.add(v1)
			path = (v1, path)
			if v1 == t:
				return (cost, path)
			for (c, v2) in g.get(v1, ()):
				if v2 in seen:
					continue
				prev = mins.get(v2, None)
				next = cost + c
				if prev is None or next < prev:
					mins[v2] = next
					heappush(q, (next, v2, path))
	return float('inf')

def binsearch(a, l, r, x):
	while l <= r:
		mid = l + (r - 1) // 2
		if a[mid]:
			return mid
		elif a[mid] > x:
			l = mid - 1
		else:
			r = mid + 1
	return -1

def readTree(n):
	adj = [set() for _ in range(n)]
	for _ in range(n - 1):
		(u, v) = map(int, input().split())
		adj[u - 1].add(v - 1)
		adj[v - 1].add(u - 1)
	return adj

def treeOrderByDepth(n, adj, root=0):
	parent = [-2] + [-1] * (n - 1)
	ordered = []
	q = deque()
	q.append(root)
	depth = [0] * n
	while q:
		c = q.popleft()
		ordered.append(c)
		for a in adj[c]:
			if parent[a] == -1:
				parent[a] = c
				depth[a] = depth[c] + 1
				q.append(a)
	return (ordered, parent, depth)

def isSubSequence(str1, str2):
	m = len(str1)
	n = len(str2)
	j = 0
	i = 0
	while j < m and i < n:
		if str1[j] == str2[i]:
			j = j + 1
		i = i + 1
	return j == m

def nextPowerOf2(n):
	count = 0
	if n and (not n & n - 1):
		return n
	while n != 0:
		n >>= 1
		count += 1
	return 1 << count

def cou(n):
	c = 0
	while n > 1:
		c += 1
		n //= 2
	return c

def sortsec(l):
	return sorted(l, key=lambda x: x[1])

def BinarySearch(a, x):
	i = bisect_left(a, x)
	if i:
		return i - 1
	else:
		return -1

def subarray(A):
	r = set()
	p = {0}
	for x in A:
		p = {x | y for y in p} | {x}
		r |= p
	return len(r)
for _ in range(ii()):
	n = ii()
	l = []
	for i in range(n):
		l.append(i + 1)
	print(*l[::-1])


def solve(arr, n):
	odd = 1
	even = n
	for i in range(n):
		if i % 2 == 0:
			arr[i] = even
			even -= 1
		else:
			arr[i] = odd
			odd += 1
	return ' '.join(map(str, arr))
for _ in range(int(input())):
	n = int(input())
	arr = list(range(1, n + 1))
	print(solve(arr, n))


t = int(input())
for i in range(t):
	n = int(input())
	out = '1'
	for i in range(2, n + 1):
		out += ' ' + str(i)
	print(out)


t = int(input())
for i in range(t):
	n = int(input())
	x = 0
	for j in range(1, n + 1):
		print(j, end=' ')
	print()


N = int(input())
A = []
for i in range(N):
	k = int(input())
	s = ''
	for j in range(k):
		s = s + str(j + 1) + ' '
	s = s[:-1]
	print(s)


def main():
	t = int(input())
	from math import log2
	for _ in range(t):
		n = int(input())
		p = int(log2(n))
		x = 2 ** p
		a = []
		while x:
			a.append(x)
			x //= 2
		for i in range(1, n + 1):
			if i not in a:
				a.append(i)
		print(*a)
	return
main()


T = int(input())
for i in range(T):
	n = int(input())
	print(*range(1, n + 1))


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		l1 = []
		l2 = []
		for i in range(1, n + 1):
			if i % 2 == 0:
				l1.append(i)
			else:
				l2.append(i)
		l = l1 + l2[::-1]
		print(*l)
main()


import sys, os
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = lambda : sys.stdin.readline().strip()
li = lambda : list(map(int, input().split()))
I = lambda : int(input())
for _ in range(I()):
	n = I()
	l = [i for i in range(n, 0, -1)]
	print(*l)


import time
from collections import deque

def inpt():
	return int(input())

def inpl():
	return list(map(int, input().split()))

def inpm():
	return map(int, input().split())

def solve():
	n = inpt()
	print(*list(range(1, n + 1)))

def main():
	m = 10 ** 9 + 7
	t = int(input())
	while t:
		t -= 1
		solve()
main()


import random
i = int(input())
li = list()
while i > 0:
	a = input()
	li.append(int(a))
	i -= 1
b = list()
for ele in li:
	b = random.sample(range(1, ele + 1), ele)
	for s in b:
		print(s, end=' ')
	print()


n = int(input())
ans = []
for i in range(n):
	k = int(input())
	m = [i + 1 for i in range(k)]
	i = 0
	for _ in range(k - 1):
		if i >= k - 1:
			break
		temp = m[i]
		m[i] = m[i + 1]
		m[i + 1] = temp
		i += 2
	s = ''
	for i in m:
		s += str(i) + ' '
	ans.append(s)
for i in ans:
	print(i)


t = int(input())
for i in range(t):
	n = int(input())
	for j in range(1, n + 1):
		print(f'{j} ')


t = int(input())
for _ in range(t):
	n = int(input())
	res = []
	for i in range(1, n + 1):
		res.append(i)
	print(' '.join((str(e) for e in res)))


tt = int(input())
while tt != 0:
	n = int(input())
	ans = [i + 1 for i in range(n)]
	print(*ans)
	tt -= 1


from collections import *
from sys import stdin, stderr

def rl():
	return [int(w) for w in stdin.readline().split()]
(t,) = rl()
for _ in range(t):
	(n,) = rl()
	print(*range(1, n + 1))


no = int(input())
for i in range(no):
	inp = int(input())
	for i in range(1, inp + 1):
		print(i, end=' ')
	print()


q = int(input())
for _ in range(q):
	n = int(input())
	l = list(range(n, 0, -1))
	s = ' '.join(list(map(str, l)))
	print(s)


from collections import defaultdict as dd
import sys
input = sys.stdin.readline
t = int(input())
while t:
	n = int(input())
	l = [i for i in range(1, n + 1)]
	print(*l)
	t -= 1


a = int(input())
for i in range(a):
	s = int(input())
	z = [i + 1 for i in range(s)]
	print(*z)


from sys import stdin
input = stdin.readline

def help():
	n = int(input())
	print(*list(range(1, n + 1)))
for _ in range(int(input())):
	help()


for i in range(int(input())):
	n = int(input())
	ul = n
	sl = 1
	l1 = []
	for i in range(n):
		if i % 2 == 0:
			l1.append(ul)
			ul -= 1
			print(l1[i], end=' ')
		else:
			l1.append(sl)
			sl += 1
			print(l1[i], end=' ')
	print('\n')


import sys
import heapq

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		ans = [0] * n
		for i in range(n // 2):
			ans[i] = n - 2 * i
			ans[-1 - i] = n - (2 * i + 1)
		if n % 2:
			ans[n // 2] = 1
		for i in ans:
			print(i, end=' ')
		print('')
	return
main()


import sys
import string
from collections import defaultdict
from functools import lru_cache
from collections import Counter

def mi(s):
	return map(int, s.strip().split())

def lmi(s):
	return list(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def solve(n):
	arr = [i + 1 for i in range(n)]
	print(js(arr))

def main(arr):
	for a in arr:
		solve(a)
arr = []
for (e, line) in enumerate(sys.stdin.readlines()):
	if e == 0:
		continue
	else:
		arr.append(int(line.strip()))
main(arr)


a = int(input())
for i in range(0, a):
	arr = []
	b = int(input())
	for j in range(1, b + 1):
		arr.append(str(j))
	print(' '.join(map(str, arr)))


t = int(input())
for __ in range(t):
	n = int(input())
	l = [i + 1 for i in range(n)]
	print(*l)


for tc in range(int(input())):
	x = int(input())
	arr = [z for z in range(1, x + 1)]
	print(*arr)


def f():
	for i in range(1, int(input()) + 1):
		print(i, end=' ')
	print()
for _ in range(int(input())):
	f()


for t in range(int(input())):
	n = int(input())
	ans = list(range(n, 0, -1))
	print(*ans)


cases = int(input())
answers = [] * 0
for problems in range(cases):
	n = int(input())
	if n == 1:
		answers.append('1')
	elif n == 2:
		answers.append('1 2')
	else:
		high = n
		low = 1
		bHigh = True
		temp = ''
		for i in range(n):
			if i != 0:
				temp += ' '
			if bHigh:
				temp += str(high)
				high = high - 1
				bHigh = False
			else:
				temp += str(low)
				low = low + 1
				bHigh = True
		answers.append(temp)
for answer in answers:
	print(answer)


from sys import stdin, stdout
from collections import Counter
from itertools import permutations
import bisect
import math
I = lambda : map(int, stdin.readline().split())
I1 = lambda : stdin.readline()
for _ in range(int(I1())):
	n = int(I1())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


from __future__ import division, print_function
from sys import stdin, stdout
import bisect
import math
import heapq
i_m = 9223372036854775807

def inin():
	return int(input())

def stin():
	return input()

def spin():
	return map(int, stin().split())

def lin():
	return list(map(int, stin().split()))

def matrix(n):
	return [list(map(int, input().split())) for i in range(n)]

def count2Dmatrix(i, list):
	return sum((c.count(i) for c in list))

def modinv(n, p):
	return pow(n, p - 2, p)

def GCD(x, y):
	x = abs(x)
	y = abs(y)
	if min(x, y) == 0:
		return max(x, y)
	while y:
		(x, y) = (y, x % y)
	return x

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
prime = []

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j
for _ in range(inin()):
	n = inin()
	for i in range(1, n + 1):
		print(i, end=' ')
	print('')


n = int(input())
for _ in range(n):
	q = int(input())
	ans = range(1, q + 1)
	for x in ans:
		print(x, end=' ')
	print('')


def main():
	for i in range(int(input())):
		n = int(input())
		a = [i for i in range(1, n + 1)]
		a = list(map(str, a))
		print(' '.join(a))
main()


from collections import defaultdict
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange

def print_case_iterable(case_num, iterable):
	print('Case #{}: {}'.format(case_num, ' '.join(map(str, iterable))))

def print_case_number(case_num, iterable):
	print('Case #{}: {}'.format(case_num, iterable))

def print_iterable(A):
	print(' '.join(A))

def read_int():
	return int(f.readline().strip())

def read_int_array():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def read_string():
	return list(f.readline().strip())

def ri():
	return int(f.readline().strip())

def ria():
	return [int(x) for x in f.readline().strip().split(' ')]

def rns():
	a = [x for x in f.readline().split(' ')]
	return (int(a[0]), a[1].strip())

def rs():
	return list(f.readline().strip())

def bi(x):
	return bin(x)[2:]
from collections import deque
import math
NUMBER = 10 ** 9 + 7

def factorial(n):
	M = NUMBER
	f = 1
	for i in range(1, n + 1):
		f = f * i % M
	return f

def mult(a, b):
	return a * b % NUMBER

def minus(a, b):
	return (a - b) % NUMBER

def plus(a, b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		(g, y, x) = egcd(b % a, a)
		return (g, x - b // a * y, y)

def modinv(a):
	m = NUMBER
	(g, x, y) = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m

def choose(n, k):
	if n < k:
		assert false
	return mult(factorial(n), modinv(mult(factorial(k), factorial(n - k)))) % NUMBER
from collections import deque, defaultdict
import heapq
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def dfs(g, timeIn, timeOut, depths, parents):
	cnt = 0
	stack = [[1, 0, 0, 0]]
	while stack:
		(v, neig_i, parent, depth) = stack[-1]
		parents[v] = parent
		depths[v] = depth
		if neig_i == 0:
			timeIn[v] = cnt
			cnt += 1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i += 1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u, 0, v, depth + 1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
cnt = 0

@bootstrap
def dfs(v, adj, timeIn, timeOut, depths, parents, parent=0, depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt += 1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u, adj, timeIn, timeOut, depths, parents, v, depth + 1)
	timeOut[v] = cnt
	cnt += 1
	yield

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)

def get_num_2_5(n):
	twos = 0
	fives = 0
	while n > 0 and n % 2 == 0:
		n //= 2
		twos += 1
	while n > 0 and n % 5 == 0:
		n //= 5
		fives += 1
	return (twos, fives)

def shift(a, i, num):
	for _ in range(num):
		(a[i], a[i + 1], a[i + 2]) = (a[i + 2], a[i], a[i + 1])

def equal(x, y):
	return abs(x - y) <= 1e-09

def getAngle(a, b, c):
	ang = math.degrees(math.atan2(c[1] - b[1], c[0] - b[0]) - math.atan2(a[1] - b[1], a[0] - b[0]))
	return ang + 360 if ang < 0 else ang

def getLength(a, b):
	return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2)
from heapq import heapify, heappush, heappop

def bfs(adj):
	s = set()
	d = defaultdict(set)
	q = deque([])
	s.add(0)
	d[0].add(0)
	q.append((0, 0))
	while len(q) > 0:
		(v, depth) = q.popleft()
		for u in adj[v]:
			if u not in s:
				s.add(u)
				d[depth + 1].add(u)
				q.append((u, depth + 1))
	return d

def isSubsetSum(arr, n, summ):
	subarr = [[False for i in range(summ + 1)] for i in range(n + 1)]
	for i in range(n + 1):
		subarr[i][0] = True
	for i in range(1, summ + 1):
		subarr[0][i] = False
	for i in range(1, n + 1):
		for j in range(1, summ + 1):
			if j < arr[i - 1]:
				subarr[i][j] = subarr[i - 1][j]
			if j >= arr[i - 1]:
				subarr[i][j] = subarr[i - 1][j] or subarr[i - 1][j - arr[i - 1]]
	return subarr[n][summ]

def bfs(v, adj, onpath):
	s = set()
	d = defaultdict(set)
	q = deque([])
	s.add(0)
	d[0].add(0)
	q.append((0, 0))
	while len(q) > 0:
		(v, depth) = q.popleft()
		for u in adj[v]:
			if u not in s:
				s.add(u)
				d[depth + 1].add(u)
				q.append((u, depth + 1))
	return d

def solution(n):
	return ' '.join(map(str, range(1, n + 1)))

def main():
	T = 1
	T = ri()
	for i in range(T):
		n = ri()
		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			(print >> output, str(x))
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()
if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
main()


nt = int(input())
for test in range(nt):
	inp = input()
	n = int(str(inp).split(' ')[0])
	a = [0] * n
	a[-2::-2] = range(1, n // 2 + 1)
	if n % 2 == 0:
		a[1::2] = range(n // 2 + 1, n + 1)
	else:
		a[0::2] = range(n // 2 + 1, n + 1)
	print(' '.join(map(str, a)))


mod = 10 ** 9 + 7

def solve():
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()
t = 1
t = int(input())
for _ in range(t):
	solve()


import math
A = lambda : input()
B = lambda : int(input())
C = lambda : map(int, input().split())
D = lambda : list(map(int, input().split()))
t = B()
for _ in range(t):
	n = B()
	for i in range(1, n + 1):
		print(i)


k = []
for i in range(int(input())):
	k.append(int(input()))
for i in k:
	print(*range(1, i + 1))


t = int(input())
for _ in range(t):
	n = int(input())
	a = [1]
	for i in range(2, n + 1):
		a.append(i)
	for i in a:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	temp = [0 for i in range(n)]
	c = 1
	for i in range(0, n, 2):
		temp[i] = c
		c += 1
	for i in range(1, n, 2):
		temp[i] = c
		c += 1
	print(*temp)


from fractions import gcd
from itertools import combinations, permutations, accumulate, product
from collections import deque, defaultdict, Counter
import decimal
import re
import sys
sys.setrecursionlimit(10000000)
mod = 10 ** 9 + 7

def readInts():
	return list(map(int, input().split()))

def I():
	return int(input())
for _ in range(I()):
	a = I()
	ans = [i + 1 for i in range(a)]
	print(*ans)


t = int(input())
for ex in range(t):
	n = int(input())
	ans = '1'
	for i in range(2, n + 1):
		ans += ' ' + str(i)
	print(ans)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline().strip())
	ans = [i for i in range(1, n + 1)]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	if n % 2 == 0:
		ans = []
		mid = n // 2
		nex = mid + 1
		while mid != 0 and nex != n:
			ans.append(nex)
			ans.append(mid)
			mid -= 1
			nex += 1
		ans.append(nex)
		ans.append(mid)
		print(*ans)
	else:
		mid = n // 2
		nex = mid + 1
		ans = []
		while mid != 0 or nex != n:
			ans.append(nex)
			ans.append(mid)
			mid -= 1
			nex += 1
		ans.append(nex)
		print(*ans)


for t in range(int(input())):
	for s in range(1, int(input()) + 1):
		print(s, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [j + 1 for j in range(n)]
	print(*a)


t = int(input())
for case in range(0, t):
	n = int(input())
	ascending = range(1, n + 1)
	ascending = map(str, ascending)
	print(' '.join(ascending))


num_tests = int(input())
for _ in range(num_tests):
	n = int(input())
	print(*list(range(1, n + 1)))


def main():
	from sys import stdin, stdout
	N = int(input())
	nums = [int(a.strip()) for a in stdin.readlines()]
	for i in range(N):
		arr = ''
		for j in range(1, nums[i] + 1):
			arr += str(j) + ' '
		print(arr)
main()


for _ in range(int(input())):
	n = int(input())
	p = list(range(n))
	for i in p:
		print(i + 1, end=' ')
	print()


rr = lambda : input().strip()
T = int(rr())
for _ in range(T):
	n = int(rr())
	S = [i for i in range(1, n + 1)]
	print(*S)


t1 = int(input())
for _ in range(t1):
	n = int(input())
	t = ''
	for i in range(n):
		t += str(i + 1) + ' '
	print(t[:-1])


for i in range(int(input())):
	n = int(input())
	l = []
	for i in range(1, n + 1):
		l.append(str(i))
	print(' '.join(l))


t = int(input())
l = []
for i in range(t):
	n = int(input())
	l.append(n)
for j in l:
	for k in range(1, j + 1):
		print(k, end=' ')
	print('')


def solve():
	pass
t = int(input())
for i in range(t):
	n = int(input())
	a = [int(j) for j in range(1, n + 1)]
	print(*a)


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		N = int(input())
		ans = []
		for i in range(1, N + 1):
			ans.append(i)
		print(*ans)
main()


def main():
	for __ in [0] * int(input()):
		N = int(input())
		print(*list(range(1, N + 1)))
main()


TC = int(input())
for _ in range(TC):
	N = int(input())
	ans = [-1] * N
	(lb, ub) = (1, N)
	for i in range(N):
		if i % 2 == 0:
			ans[i] = ub
			ub -= 1
		else:
			ans[i] = lb
			lb += 1
	print(' '.join(map(str, ans)))


from sys import stdin, stdout, setrecursionlimit
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007
tc = ii1()
for _ in range(tc):
	n = ii1()
	arr = list(range(1, n + 1))
	print(*arr)


a = int(input())
s = []
for i in range(a):
	t = []
	b = int(input())
	for j in range(1, b + 1):
		t.append(str(j))
	s.append(t)
for l in range(a):
	print(' '.join(s[l]))


n = int(input())
for _ in range(n):
	m = int(input())
	ar = []
	x = 0
	for i in range(m):
		if i % 2 == 0:
			if 1 + x not in ar:
				ar.insert(0, 1 + x)
			if m - x not in ar:
				ar.append(m - x)
		else:
			if 1 + x not in ar:
				ar.append(1 + x)
			if m - x not in ar:
				ar.insert(0, m - x)
		x += 1
	for i in ar:
		print(i, end=' ')
	print()


import sys
import heapq
import math
from collections import deque
from collections import defaultdict
from collections import Counter
modH = int(10 ** 9) + 7
I = lambda : list(map(int, input().split(' ')))

def PRINT(lst, sep=' '):
	print(sep.join(map(str, lst)))
for _ in range(int(input())):
	n = int(input())
	lst = []
	for i in range(n // 2):
		lst.append(i + 1)
	lst.reverse()
	lst.append(n)
	for i in range(n // 2, n - 1):
		lst.append(i + 1)
	PRINT(lst)


for _ in range(int(input())):
	a = int(input())
	arr = list(range(1, a + 1))
	print(*arr)


T = int(input())
for _ in range(T):
	N = int(input())
	ans = range(N, 0, -1)
	print(*ans)


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	ans = [i for i in range(n, 0, -1)]
	print(*ans)


a = int(input())
for _ in range(a):
	x = int(input())
	li = []
	for i in range(1, x + 1):
		li.append(i)
	print(*li)


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	for x in range(1, n + 1):
		print(x, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(i + 1)
	print(' '.join((repr(y) for y in a)))


def mine(lt):
	mi = lt[0]
	for i in range(len(lt)):
		if lt[i] < mi:
			mi = lt[i]
	return mi
q = int(input())
for d in range(q):
	a = int(input())
	temp = []
	for i in range(a):
		print(i + 1)


def perm(n):
	lst1 = []
	flag = 0
	for i in range(1, n + 1):
		lst1.append(i)
		if i > 1 and flag == 0:
			a = lst1.pop(0)
			lst1.append(a)
			flag = 1
	return lst1
t = int(input())
for i in range(t):
	n = int(input())
	a = perm(n)
	for i in a:
		print(i, end=' ')
	print()


import sys

def scan():
	return list(map(int, sys.stdin.readline().strip().split()))

def solution():
	for _ in range(int(input())):
		n = int(input())
		for i in range(n, 0, -1):
			print(i, end=' ')
		print()
solution()


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

def solve():
	n = N()
	print(*range(n, 0, -1))
testcase(int(inp()))


test_cnt = int(input())
for tn in range(test_cnt):
	n = int(input())
	s = [str(i + 1) for i in range(n)]
	print(' '.join(s))


t = int(input())
for i in range(0, t):
	n = int(input())
	subarr = [x for x in range(1, n + 1)]
	print(*subarr)


import sys
fast_reader = sys.stdin.readline
fast_writer = sys.stdout.write

def input():
	return fast_reader().strip()

def print(*argv):
	fast_writer(' '.join((str(i) for i in argv)))
	fast_writer('\n')
for _ in range(int(input())):
	n = int(input())
	print(*[i + 1 for i in range(n)])


for _ in range(int(input())):
	n = int(input())
	result = []
	big = n
	small = 1
	for i in range(n):
		if i % 2 == 0:
			result.append(big)
			big -= 1
		else:
			result.append(small)
			small += 1
	print(*result)


import random
for s in range(int(input())):
	n = int(input())
	print(*range(1, n + 1))


def main():
	import sys
	input = sys.stdin.readline
	sys.setrecursionlimit(10 ** 6)
	t = int(input())
	for _ in range(t):
		n = int(input())
		l = []
		for i in range(1, n + 1):
			l.append(i)
		print(*l)
main()


import sys
import os
import math
import copy
from math import gcd
from bisect import bisect
from io import BytesIO, IOBase
from math import sqrt, floor, factorial, gcd, log, ceil
from collections import deque, Counter, defaultdict
from itertools import permutations, combinations
import itertools

def Int():
	return int(sys.stdin.readline())

def Mint():
	return map(int, sys.stdin.readline().split())

def Lstr():
	return list(sys.stdin.readline().strip())

def Str():
	return sys.stdin.readline().strip()

def Mstr():
	return map(str, sys.stdin.readline().strip().split())

def List():
	return list(map(int, sys.stdin.readline().split()))

def Hash():
	return dict()

def Mod():
	return 1000000007

def Ncr(n, r, p):
	return fact[n] * (ifact[r] * ifact[n - r] % p) % p

def Most_frequent(list):
	return max(set(list), key=list.count)

def Mat2x2(n):
	return [List() for _ in range(n)]

def Lcm(x, y):
	return x * y // gcd(x, y)

def dtob(n):
	return bin(n).replace('0b', '')

def btod(n):
	return int(n, 2)

def common(l1, l2):
	return set(l1).intersection(l2)

def solution():
	for _ in range(Int()):
		N = Int()
		for i in range(N):
			print(i + 1, end=' ')
		print()
solution()


t = int(input())
for _ in range(t):
	n = int(input())
	nlist = list(range(1, n + 1))
	for i in nlist:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	ans = [None] * n
	for i in range((n + 1) // 2):
		ans[i * 2] = i + 1
	for i in range(n // 2):
		ans[i * 2 + 1] = i + (n + 1) // 2 + 1
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	mi = 1 + (n + 1) // 2
	res = [None] * n
	res[::2] = range(1, mi)
	res[1::2] = range(mi, n + 1)
	print(*res)


for i in range(int(input())):
	namba = int(input())
	lista = [i + 1 for i in range(namba)]
	for i in lista:
		print(i, end=' ')


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	n = inp()
	print(*[i + 1 for i in range(n)])


t = int(input())
for qq in range(t):
	n = int(input())
	if n % 2 == 0:
		for i in range(1, n // 2 + 1):
			print(i * 2, end=' ')
		for i in range(1, n // 2 + 1):
			print(i * 2 - 1, end=' ')
		print()
	else:
		for i in range(1, n // 2 + 1):
			print(i * 2, end=' ')
		for i in range(1, n // 2 + 2):
			print(i * 2 - 1, end=' ')
		print()


def ans(n):
	a = [n - i for i in range(n)]
	s = ''
	for i in a:
		s = s + str(i) + ' '
	print(s)
	return
m = int(input())
for i in range(m):
	n = int(input())
	ans(n)


import math
from collections import deque
from sys import stdin, stdout
from string import ascii_letters
input = stdin.readline
print = stdout.write
letters = ascii_letters[:26]
for _ in range(int(input())):
	n = int(input())
	for i in range(n, 0, -1):
		print(str(i) + ' ')
	print('\n')


t = int(input())
ls = []
for z in range(t):
	temp = int(input())
	l = temp
	s = []
	for i in range(temp):
		s.append(0)
	for i in range(temp - 1, -1, -2):
		s[i] = l
		l -= 1
	ind = temp % 2
	for i in range(ind, temp, 2):
		s[i] = l
		l -= 1
	st = ''
	for i in s:
		st += str(i) + ' '
	st = st.rstrip()
	ls.append(st)
for i in ls:
	print(i)


t = int(input())
while t:
	t -= 1
	n = int(input())
	lst = [i for i in range(1, n + 1)]
	print(*lst)


for _ in range(int(input())):
	n = int(input())
	a = [i for i in range(n, 0, -1)]
	print(*a)


t = int(input())
for _ in range(t):
	n = int(input())
	array = []
	for i in range(n):
		array.append(i + 1)
	for ele in array:
		print(ele, end=' ')


t = int(input())
while t:
	n = int(input())
	l = list(range(1, n + 1))
	print(*l)
	t -= 1


for i in range(int(input())):
	n = int(input())
	ans = []
	k = 1
	for t in range(n):
		ans.append(k)
		k += 1
	print(' '.join(map(str, ans)))


for testcase in range(int(input())):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for _ in range(int(input())):
	print(' '.join([str(i) for i in range(1, int(input()) + 1)]))


for _ in range(int(input())):
	n = int(input())
	a = [*range(1, n + 1)][::-1]
	print(*a)


T = int(input())
for t in range(T):
	n = int(input())
	for x in range(1, n + 1):
		print(x, end=' ')
	print('')


from itertools import permutations as perm
for i in range(int(input())):
	n = int(input())
	a = n // 2 + 1
	b = n // 2
	ans = [a]
	counter = 1
	for j in range(1, n):
		if j % 2 == 0:
			ans.append(a + counter)
			counter += 1
		else:
			ans.append(a - counter)
	for j in ans:
		print(j, end=' ')
	print()


def main():
	testcase = int(input())
	for _ in range(testcase):
		n = int(input())
		for i in range(1, n + 1):
			print(i, end=' ')
		print()
main()


for _ in range(int(input())):
	n = int(input())
	ans = [i for i in range(1, n + 1)]
	print(*ans, sep=' ')


def solve(x):
	n = x // 2
	m = n + 1
	while n >= 0 and m <= x:
		print(m, end=' ')
		if n != 0:
			print(n, end=' ')
		m += 1
		n -= 1
	print()
for _ in range(int(input())):
	solve(int(input()))


tc = int(input())
for ctr in range(tc):
	a = int(input())
	print(*[i for i in range(1, a + 1)])


n = int(input())
for _ in range(n):
	m = int(input())
	for i in range(m, 0, -2):
		print(i, end=' ')
	for i in range(m - 1, 0, -2):
		print(i, end=' ')
	print()


tc = int(input())
for _ in range(tc):
	n = int(input())
	print(' '.join([str(qwe) for qwe in list(range(1, n + 1))]))


for _ in range(int(input())):
	n = int(input())
	mid = n // 2
	nxt = mid + n % 2
	for i in range(1, mid + 1):
		print(i, nxt + i, end=' ')
	if n % 2:
		print(mid + 1)


for z in range(int(input())):
	n = int(input())
	arr = [x for x in range(1, n + 1)]
	print(*arr)


def ip():
	return int(input())

def sip():
	return input()

def mip():
	return map(int, input().split())

def lip():
	return list(map(int, input().split()))

def matip(n, m):
	lst = []
	for i in range(n):
		arr = lip()
		lst.append(arr)
	return lst
t = ip()
while t:
	t -= 1
	n = ip()
	lst = []
	for i in range(1, n + 1):
		lst.append(i)
	print(*lst)


for _ in range(int(input())):
	n = int(input())
	ans = []
	st = n
	en = 1
	while en <= st:
		if st == en:
			ans.append(st)
			break
		ans.append(st)
		ans.append(en)
		en += 1
		st -= 1
	print(*ans)


t = int(input())
ar = []
for i in range(t):
	n = int(input())
	a = [i for i in range(1, n + 1)]
	ar.append(a)
for i in ar:
	s = ' '.join((str(j) for j in i))
	print(s)


def solve():
	print(*range(1, int(input()) + 1))

def main():
	cases()

def cases():
	for _ in range(int(input())):
		solve()
main()


import io, os
R = lambda : map(int, input().split())
for _ in range(int(input())):
	print(*[i for i in range(1, int(input()) + 1)])


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if True else 1):
	n = int(input())
	print(*[i for i in range(n, 0, -1)])


def examA():
	T = I()
	ans = []
	for _ in range(T):
		N = I()
		cur = [i + 1 for i in range(N)]
		ans.append(cur)
	for v in ans:
		print(' '.join(map(str, v)))
	return

def examB():
	T = I()
	ans = []
	for _ in range(T):
		cur = 0
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examC():
	T = I()
	ans = []
	for _ in range(T):
		cur = 0
		ans.append(cur)
	for v in ans:
		print(v)
	return

def examD():
	ans = 0
	print(ans)
	return

def examE():
	ans = 0
	print(ans)
	return

def examF():
	ans = 0
	print(ans)
	return
from decimal import getcontext, Decimal as dec
import sys, bisect, heapq
from copy import deepcopy
from heapq import heappop, heappush, heapify
from collections import Counter, defaultdict, deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def I():
	return int(input())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def DI():
	return dec(input())

def LDI():
	return list(map(dec, sys.stdin.readline().split()))

def LSI():
	return list(map(str, sys.stdin.readline().split()))

def LS():
	return sys.stdin.readline().split()

def SI():
	return sys.stdin.readline().strip()
global mod, mod2, inf, alphabet, _ep
mod = 10 ** 9 + 7
mod2 = 998244353
inf = 10 ** 18
_ep = dec('0.000000000001')
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}
getcontext().prec = 28
sys.setrecursionlimit(2 * 10 ** 5)
examA()


import random
w = int(input())
for i in range(w):
	massiv = []
	n = int(input())
	for i in range(1, n + 1):
		massiv.append(i)
	random.shuffle(massiv)
	print(*massiv)


from sys import stdin
input = lambda : stdin.readline().strip()
from math import ceil, sqrt, factorial, gcd
from collections import deque
for _ in range(int(input())):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	print(*l)


def suborray(n):
	l = list(range(1, n + 1))
	return l
t = int(input())
for _ in range(t):
	n = int(input())
	result = suborray(n)
	print(*result, sep=' ')


for _ in range(int(input())):
	s = ''
	for i in range(int(input())):
		s += str(i + 1) + ' '
	print(s)


t = int(input())
while t > 0:
	n = input()
	if n.isdigit():
		n = int(n)
		for i in range(1, n + 1):
			print(i, end=' ')
		t = t - 1
	else:
		continue


import sys
TEST = 0
if TEST == 1:
	input_file = open('inputA.txt', 'r')
	input_from_file = input_file.readlines()

def read_int():
	if TEST:
		return int(input_from_file.pop(0))
	else:
		return int(sys.stdin.readline())

def read_ints():
	if TEST:
		return list(map(int, input_from_file.pop(0).rstrip().split()))
	else:
		return list(map(int, sys.stdin.readline().split()))

def read_str_to_list():
	if TEST:
		in1 = input_from_file.pop(0).rstrip()
	else:
		in1 = sys.stdin.readline().rstrip()
	return [x for x in in1]
tests = read_int()

def isSeqOk(lst):
	if len(lst) == 1:
		return True
	if len(lst) == 2:
		return lst[1] | lst[2] >= 2
	for i in range(len(lst) - 1):
		for j in range(i + 1, len(lst)):
			x = lst[i] | lst[j]
			if j - i > 1:
				x = x | lst[i + 1]
			if j - i > 2:
				x = x | lst[j - 1]
			if x < j + 1 - (i + 1) + 1:
				return False
	return True
ch = isSeqOk([1, 1, 5, 4, 7, 1, 1])
for test in range(tests):
	n = read_int()
	if n == 1:
		print('1')
		continue
	mid = int(n / 2)
	(u, d) = (mid + 1, mid)
	ans = []
	k = 0
	while True:
		if u <= n:
			ans.append(u)
			u += 1
			k += 1
		if d > 0:
			ans.append(d)
			d -= 1
			k += 1
		if k == n:
			break
	print(*ans)


for i in range(int(input())):
	n = int(input())
	arry = [i + 1 for i in range(0, n)]
	print(*arry, sep=' ')


from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
	return int(input())

def rl():
	return list(map(int, input().split()))

def solve():
	n = ri()
	for i in range(1, (n + 2) // 2):
		print(i, n + 1 - i, end=' ')
	if n % 2 == 1:
		print((n + 2) // 2)
	else:
		print()
mode = 'T'
if mode == 'T':
	t = ri()
	for i in range(t):
		solve()
else:
	solve()


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2
from bisect import bisect_right, bisect_left
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def factorial(n):
	if n == 0:
		return 1
	return n * factorial(n - 1)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)
MOD = 1000000007
PMOD = 998244353
T = 1
T = int(stdin.readline())
for _ in range(T):
	n = int(stdin.readline())
	print(*range(1, n + 1))


def anos():
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
t = int(input())
for i in range(t):
	a = anos()


def find_good_permutation(n):
	return range(1, n + 1)

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		good_permutation = find_good_permutation(n)
		print(*good_permutation)
main()


for i in range(int(input())):
	n = int(input())
	s = [int(i) for i in range(n, 0, -1)]
	print(*s)


T = int(input())
for _ in range(T):
	N = int(input())
	arr = range(1, N + 1)
	print(*arr)


import sys
input = iter(sys.stdin.read().splitlines()).__next__
t = int(input())
for _ in range(t):
	n = int(input())
	permutation = list(range(1, n + 1, 2)) + list(range(n - n % 2, 0, -2))
	print(*permutation)


t = int(input())
myList = []
for _ in range(t):
	n = int(input())
	s = list(range(1, n + 1))
	myList.append(s)
for elem in myList:
	print(*elem)


for _ in range(int(input())):
	n = int(input())
	ans = list((int(num) for num in range(1, n + 1)))
	print(*ans)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print(1)
		continue
	print(n, 1, end=' ')
	for x in range(n - 1, 1, -1):
		print(x, end=' ')


for I in range(int(input())):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	listi = []
	for i in range(1, n + 1):
		listi.append(i)
	for i in range(n):
		print(listi[i], end=' ')
	print()


gi = lambda : list(map(int, input().split()))
for _ in range(gi()[0]):
	(n,) = gi()
	print(' '.join(map(str, list(range(1, n + 1)))))


testcases = int(input())
for i in range(testcases):
	n = int(input())
	j = 1
	k = n
	temp = []
	while j <= k:
		if j == k:
			temp.append(j)
		else:
			temp.append(k)
			temp.append(j)
		j += 1
		k -= 1
	for ele in temp:
		print(ele, end=' ')
	print()


for _ in range(int(input())):
	N = int(input())
	array = []
	(a, b) = (0, 0)
	for i in range(N // 2 + 1):
		array.append(N - a)
		a += 1
		b += 1
		array.append(b)
	print(*array[0:N])


def solve(n):
	if n == 1:
		return 1
	res = [0] * n
	nums = list(range(1, n + 1))
	i = 0
	j = n - 1
	idx = n - 1
	while i < j:
		res[idx] = nums[j]
		idx -= 1
		res[idx] = nums[i]
		idx -= 1
		i += 1
		j -= 1
	if n % 2 != 0:
		res[idx] = nums[i]
	return res
t = int(input())
for _ in range(t):
	n = int(input())
	res = solve(n)
	if res == 1:
		print(1)
	else:
		print(*res)


TN = int(input())
for TI in range(TN):
	n = int(input())
	ans = ' '.join([str(i) for i in range(1, n + 1)])
	print(ans)


t = int(input())
for _ in range(t):
	n = int(input())
	lis = list(range(1, n + 1))
	print(*lis, sep=' ')


import sys
input = sys.stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [i + 1 for i in range(n)]
	print(*a)


n = int(input())
for i in range(n):
	a = int(input())
	for j in range(a, 0, -1):
		print(j, end=' ')
	print('')


a = int(input())
for i in range(0, a):
	i = int(input())
	c = ''
	for b in range(1, i + 1):
		c += str(b) + ' '
	print(c)


def sint():
	return int(input())

def sints():
	return map(int, input().split())

def sara():
	return list(map(int, input().split()))

def sstr():
	s = input()
	return list(s[:len(s)])

def main():
	n = sint()
	for i in range(n):
		print(i + 1, end=' ')
	print()
t = sint()
while t:
	t -= 1
	main()


t = int(input())
for i in range(0, t):
	m = int(input())
	for j in range(1, m + 1):
		print(j, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	arr = []
	for i in range(n):
		arr.append(i + 1)
	print(*arr)


n = int(input())
ans_list = []
for i in range(n):
	n = int(input())
	key = n % 2
	n = [int(j) for j in range(1, n + 1)]
	ans = []
	while len(n) not in [0, 1]:
		ans.append(max(n))
		ans.append(min(n))
		del n[n.index(max(n))]
		del n[n.index(min(n))]
	if key == 1:
		ans.append(n[0])
	ans_list.append(ans)
for i in ans_list:
	print(*i)


t = int(input())
for sh in range(t):
	n = int(input())
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	ans = ''
	for x in range(n):
		y = n - x
		ans += str(y) + ' '
	print(ans)


import sys
import math
from collections import defaultdict, Counter, deque

def solve(test):
	n = int(input())
	res = [str(x) for x in range(1, n + 1)]
	print(' '.join(res))
test_cases = int(input())
for t in range(1, test_cases + 1):
	solve(t)


for _ in range(int(input())):
	lista = []
	for i in range(int(input()), 0, -1):
		lista.append(i)
	print(*lista)


T = int(input())
for t in range(T):
	N = int(input())
	for i in range(1, N + 1):
		print(i, end=' ')
	print('')


def gns():
	return list(map(int, input().split()))

def p(ns):
	print(' '.join(map(str, ns)))
t = int(input())
for i in range(t):
	n = int(input())
	p([i for i in range(1, n + 1)])


import sys
input = sys.stdin.buffer.readline
print = lambda _, end='\n': sys.stdout.write(str(_) + end)
t = int(input())
for tc in range(t):
	n = int(input())
	print(' '.join([str(i + 1) for i in range(n)]))


from math import gcd
from sys import stdin
from collections import Counter, deque
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = []
	for i in range(n):
		a.append(i + 1)
	print(*a)


for _ in range(int(input())):
	n = int(input())
	li = list()
	if n == 1:
		li.append(1)
	else:
		li.append(n)
		li.append(1)
		for i in range(2, n):
			li.append(i)
	print(*li)


for _ in range(int(input())):
	n = int(input())
	ar = [int(x) for x in range(1, n + 1)]
	temp = []
	if n == 1:
		print(1)
	else:
		print(*ar)


test_cnt = int(input())
tests = []
for _ in range(test_cnt):
	n = int(input())
	tests.append(n)
for test in tests:
	n = test
	ans = [str(i + 1) for i in range(n)][::-1]
	print(' '.join(ans))


import sys
input = sys.stdin.readline
for f in range(int(input())):
	print(*list(range(1, int(input()) + 1)))


for _ in range(int(input())):
	n = int(input())
	a = range(1, n + 1)
	for i in a:
		print(i, end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	ans = []
	for i in range(1, n + 1):
		ans.append(str(i))
	print(' '.join(ans))


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		print(n - i, end=' ')
	print()


import sys
input = iter(sys.stdin.read().splitlines()).__next__
sys.setrecursionlimit(10000)
TC = int(input())
for tc in range(TC):
	N = int(input())
	res = range(1, N + 1)
	print(' '.join(map(str, res)))


production = True
import sys, math, collections, bisect, itertools, heapq, decimal, random, copy, re

def input(f=0, m=0):
	if m > 0:
		return [input(f) for i in range(m)]
	else:
		l = sys.stdin.readline()[:-1]
		if f >= 10:
			u = False
			f = int(str(f)[-1])
		else:
			u = True
		if f == 0:
			p = [l]
		elif f == 1:
			p = list(map(int, l.split()))
		elif f == 2:
			p = list(map(float, l.split()))
		elif f == 3:
			p = list(l)
		elif f == 4:
			p = list(map(int, list(l)))
		elif f == 5:
			p = l.split()
		return p if u else p[0]

def out(l, f=0, n=True):
	if f == 0:
		p = str(l)
	elif f == 1:
		p = ' '.join(map(str, l))
	elif f == 2:
		p = '\n'.join(map(str, l))
	elif f == 3:
		p = ''.join(map(str, l))
	print(p, end='\n' if n else '')

def log(*args):
	if not production:
		print('$$$', end='')
		print(*args)
enu = enumerate
ter = lambda a, b, c: b if a else c
ceil = lambda a, b: -(-a // b)

def mapl(i, f=0):
	if f == 0:
		return list(map(int, i))
	elif f == 1:
		return list(map(str, i))
	elif f == 2:
		return list(map(list, i))

def solve():
	n = input(11)
	a = list(range(1, n + 1))
	out(a, 1)
	log()
	return
for i in range(input(11)):
	solve()


from math import *
from collections import *
from random import *
from decimal import Decimal
from heapq import *
from bisect import *
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())

def inp():
	return int(input())

def st1():
	return input().rstrip('\n')
t = inp()
while t:
	t -= 1
	n = inp()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


import sys
input = lambda : sys.stdin.readline().strip()
t = int(input())
while t:
	t -= 1
	n = int(input())
	print(' '.join(map(str, [i + 1 for i in range(n)])))


n = int(input())
liste = []
for rep in range(n):
	m = int(input())
	liste.append(m)
for number in liste:
	ans = [str(i) for i in range(1, number + 1)]
	print(' '.join(ans))


import sys
import math
from collections import defaultdict, Counter
t = int(input())
for i in range(t):
	n = int(input())
	print(*list(range(n, 0, -1)))


t = int(input())
R = lambda : map(int, input().split())
answers = []
for i in range(0, t):
	n = int(input())
	l = list(range(1, n + 1))
	answers.append(l)
for x in answers:
	for j in x:
		print(j, end=' ')
	print()


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdarr = lambda : map(int, stdstr().split())
mod = 1000000007
for _ in range(stdint()):
	n = stdint()
	res = []
	for i in range(1, n + 1):
		res.append(i)
	print(*res)


import bisect
import math
import heapq
import random

def unpack(func=int):
	return map(func, input().split())

def l_unpack(func=int):
	return list(map(func, input().split()))

def s_unpack(func=int, rev=False):
	return sorted(map(func, input().split()), reverse=rev)

def ml_unpack(n):
	return [int(input()) for _ in range(n)]

def range_n():
	return range(int(input()))

def getint():
	return int(input())

def counter(a):
	d = {}
	for x in a:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	return d

def factor(n):
	d = {}
	while not n % 2:
		d[2] = d.get(2, 0) + 1
		n //= 2
	i = 3
	while i * i <= n:
		while not n % i:
			d[i] = d.get(i, 0) + 1
			n //= i
		i += 2
	if n > 1:
		d[n] = d.get(n, 0) + 1
	return d

def main():
	for _ in range_n():
		n = getint()
		a = []
		(hi, lo) = (n, 1)
		for i in range(n // 2):
			a.append(hi)
			a.append(lo)
			hi -= 1
			lo += 1
		if n & 1:
			a.append(hi)
		print(*a)
main()


def func():
	n = int(input())
	for i in range(1, n + 1, 1):
		print(i, end=' ')
for _ in range(int(input())):
	func()


t = int(input())
for _ in range(t):
	n = int(input())
	l = [i for i in range(1, n + 1)]
	ans = []
	i = 0
	j = n - 1
	while i <= j:
		if i != j:
			ans.append(l[i])
			ans.append(l[j])
		else:
			ans.append(l[i])
		i = i + 1
		j = j - 1
	for i in range(n):
		if i != n - 1:
			print(ans[i], end=' ')
		else:
			print(ans[-1])


from sys import stdin
tt = int(stdin.readline())
for loop in range(tt):
	n = int(stdin.readline())
	ans = [i + 1 for i in range(n)]
	print(*ans)


def solve():
	n = int(input())
	ans = list(range(1, n + 1))
	return ' '.join([str(i) for i in ans])
t = int(input())
ans = []
while t:
	ans.append(str(solve()))
	t -= 1
print('\n'.join(ans))


t = int(input())
results = []
for num in range(t):
	n = int(input())
	result = []
	for a in range(n):
		result.append(str(a + 1))
	result = ' '.join(result)
	results.append(result)
for result in results:
	print(result)


a = int(input())
for x in range(a):
	b = int(input())
	c = [y for y in range(1, b + 1)]
	print(*c)


from sys import stdin
g = lambda : stdin.readline().strip()
gl = lambda : g().split()
gil = lambda : [int(var) for var in gl()]
gcl = lambda : list(g())
mod = int(1000000000.0) + 7
(t,) = gil()
for _ in range(t):
	(n,) = gil()
	for i in range(1, n + 1):
		print(i, end=' ')
	print()


for t in range(int(input())):
	print(' '.join([str(i + 1) for i in range(int(input()))]))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
for _ in range(N()):
	n = N()
	a = 1
	res = []
	for _ in range(n >> 1):
		res.append(a)
		res.append(a + (n >> 1))
		a += 1
	if n & 1:
		res = [n] + res
	print_list(res)


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	arr = [int(i + 1) for i in range(n)]
	ans.append(arr)
for a in ans:
	for ele in a:
		print(ele, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	ans = [i for i in range(1, n + 1)]
	print(*ans)


from sys import stdin, exit
from bisect import bisect_left as bl, bisect_right as br
input = lambda : stdin.readline()[:-1]
intput = lambda : int(input())
sinput = lambda : input().split()
intsput = lambda : map(int, sinput())

def dprint(*args, **kwargs):
	if debugging:
		print(*args, **kwargs)
debugging = 1
t = intput()
for _ in range(t):
	n = intput()
	print(*range(1, n + 1))


T = int(input())
for _ in range(T):
	N = int(input())
	print(' '.join([str(i + 1) for i in range(N)]))


for _ in range(int(input())):
	num = int(input())
	i = 1
	j = num
	ans = []
	while i < j:
		ans += [i, j]
		i += 1
		j -= 1
	if num % 2 != 0:
		ans += [i]
	print(*ans)


rw = int(input())
for reqw in range(rw):
	n = int(input())
	for i in range(n):
		print(i + 1, end=' ')
	print('')


import sys
input = sys.stdin.readline
from bisect import bisect_left
from bisect import bisect_right
from math import ceil, factorial

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i

def factoriazation(x):
	ret = {}
	while x != 1:
		ret[spf[x]] = ret.get(spf[x], 0) + 1
		x = x // spf[x]
	return ret

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
for _ in range(int(input())):
	n = int(input())
	ans = [i for i in range(1, n + 1)]
	print(*ans)


import time, math as mt, bisect as bs, sys
from sys import stdin, stdout
from collections import deque
from fractions import Fraction
from collections import Counter
from collections import OrderedDict
pi = 3.141592653589793

def II():
	return int(stdin.readline())

def IP():
	return map(int, stdin.readline().split())

def L():
	return list(map(int, stdin.readline().split()))

def P(x):
	return stdout.write(str(x) + '\n')

def PI(x, y):
	return stdout.write(str(x) + ' ' + str(y) + '\n')

def lcm(a, b):
	return a * b // gcd(a, b)

def gcd(a, b):
	if a == 0:
		return b
	elif b == 0:
		return a
	if a > b:
		return gcd(a % b, b)
	else:
		return gcd(a, b % a)

def bfs(adj, v):
	visited = [False] * (v + 1)
	q = deque()
	while q:
		pass

def sieve():
	li = [True] * (2 * 10 ** 5 + 5)
	(li[0], li[1]) = (False, False)
	for i in range(2, len(li), 1):
		if li[i] == True:
			for j in range(i * i, len(li), i):
				li[j] = False
	prime = []
	for i in range(2 * 10 ** 5 + 5):
		if li[i] == True:
			prime.append(i)
	return prime

def setBit(n):
	count = 0
	while n != 0:
		n = n & n - 1
		count += 1
	return count
mx = 10 ** 7
spf = [mx] * (mx + 1)

def SPF():
	spf[1] = 1
	for i in range(2, mx + 1):
		if spf[i] == mx:
			spf[i] = i
			for j in range(i * i, mx + 1, i):
				if i < spf[j]:
					spf[j] = i
	return

def readTree(n, e):
	adj = [set() for i in range(n + 1)]
	for i in range(e):
		(u1, u2) = IP()
		adj[u1].add(u2)
	return adj
mod = 10 ** 9 + 7

def solve():
	n = II()
	li = [i for i in range(1, n + 1)]
	print(*li)
t = II()
for i in range(t):
	solve()


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def solve():
	n = int(inputi())
	print(' '.join(map(str, range(1, n + 1))))

def main():
	t = int(inputi())
	for _ in range(t):
		solve()
main()


t = int(input())
for x in range(t):
	a = list(range(1, int(input()) + 1))
	a.sort(reverse=True)
	print(*a)


def soln():
	n = int(input())
	li = []
	for i in range(1, n + 1):
		li.append(str(i))
	print(' '.join(li))
for i in range(int(input())):
	soln()


for ii in range(int(input())):
	n = int(input())
	print(*list(range(1, n + 1)))


from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
import sys

def func(n):
	pass
t = int(input())
for i in range(t):
	n = int(input())
	for j in range(n, 0, -1):
		print(j, end=' ')
	print()


n = int(input())
k = []
for i in range(n):
	t = int(input())
	ans = [t - i for i in range(t)]
	k.append(ans)
for i in k:
	print(*i)


for _ in range(int(input())):
	L = [i for i in range(1, int(input()) + 1)]
	for num in L:
		print(num, end=' ')
	print()


import sys
from itertools import permutations
from functools import reduce
from copy import deepcopy
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def check(p):
	for i in range(len(p) + 1):
		for j in range(i + 1, len(p) + 1):
			sub = p[i:j]
			if reduce(lambda x, y: x | y, sub) < len(sub):
				return False
	return True

def main():
	nc = inp()
	for i in range(0, nc):
		n = inp()
		for p in permutations(range(1, n + 1)):
			if check(p):
				print(' '.join([str(j) for j in p]))
				break
main()


num = int(input())
for i in range(num):
	n = int(input())
	result = []
	i = 1
	while len(result) < n:
		if n - len(result) == 1:
			result.append(f'{n}')
		else:
			result.append(f'{i}')
			if n - i == i and n - len(result) != 1:
				result.append(f'{n - i + 1}')
			elif n - i != i and n - len(result) != 1:
				result.append(f'{n - i}')
		i += 1
	if len(result) > 1:
		print(' '.join(result))
	else:
		print(1)