Recall that a permutation of length $n$ is an array where each element from $1$ to $n$ occurs exactly once.

For a fixed positive integer $d$, let's define the cost of the permutation $p$ of length $n$ as the number of indices $i$ $(1 \le i < n)$ such that $p_i \cdot d = p_{i + 1}$.

For example, if $d = 3$ and $p = [5, 2, 6, 7, 1, 3, 4]$, then the cost of such a permutation is $2$, because $p_2 \cdot 3 = p_3$ and $p_5 \cdot 3 = p_6$.

Your task is the following one: for a given value $n$, find the permutation of length $n$ and the value $d$ with maximum possible cost (over all ways to choose the permutation and $d$). If there are multiple answers, then print any of them.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 500$) — the number of test cases.

The single line of each test case contains a single integer $n$ ($2 \le n \le 2 \cdot 10^5$).

The sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.


-----Output-----

For each test case, print the value $d$ in the first line, and $n$ integers in the second line — the permutation itself. If there are multiple answers, then print any of them.


-----Examples-----

Input
2
2
3
Output
2
1 2
3
2 1 3


-----Note-----

None

Difficulty: EASY

Solutions:
for i in range(int(input())):
	n = int(input())
	print(2)
	s = ''
	for i in range(0, n + 1, 2):
		j = i + 1
		while j <= n:
			s += str(j) + ' '
			j = j * 2
	print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	permutation = ''
	for i in range(1, n + 1, 2):
		while i <= n:
			permutation += f'{i} '
			i <<= 1
	print(2)
	print(permutation)


t = int(input())
for i in range(t):
	n = int(input())
	print(2)
	k = 1
	ans = ''
	while k <= n // 2:
		q = k
		while q <= n:
			ans += str(q) + ' '
			q *= 2
		k += 2
	for j in range(n // 2 + 1 + n // 2 % 2, n + 1, 2):
		ans += str(j) + ' '
	print(ans)


iter = int(input())
for i in range(iter):
	n = int(input())
	s = ''
	for i in range(1, n + 1, 2):
		ind = i
		while ind <= n:
			s += str(ind) + ' '
			ind *= 2
	print(2)
	print(s)


for i in range(int(input())):
	n = int(input())
	print('2')
	p = 1
	s = ''
	while p <= n:
		x = p
		while x <= n:
			s += str(x) + ' '
			x *= 2
		p += 2
	print(s)


import math

def main():
	n = int(input())
	lst = []
	needed = [True] * (n + 1)
	base = 0
	lim = math.ceil(n * 0.5)
	while base <= lim:
		base += 1
		if not needed[base]:
			continue
		i = base
		while i <= n:
			if not needed[i]:
				continue
			lst.append(i)
			needed[i] = False
			i *= 2
	for (i, isNeeded) in enumerate(needed):
		if i == 0:
			continue
		if isNeeded:
			lst.append(i)
	string = ''
	for num in lst:
		string += str(num) + ' '
	print('2')
	print(string)
t = int(input())
for i in range(t):
	main()


for _ in range(int(input())):
	n = int(input())
	print(2)
	vis = [False for i in range(n + 10)]
	pri = ''
	for i in range(1, n + 1):
		if not vis[i]:
			ind = i
			while ind <= n:
				pri += str(ind) + ' '
				vis[ind] = True
				ind *= 2
	print(pri)


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


for _ in range(int(input())):
	n = int(input())
	print(2)
	z = [False for i in range(1, n + 10)]
	l = ''
	for i in range(1, n + 1):
		if not z[i]:
			j = i
			while j < n + 1:
				l += str(j) + ' '
				z[j] = True
				j *= 2
	print(l)


def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		print(2)
		print(1, end=' ')
		array = [True] * (n + 1)
		for i in range(2, n + 1):
			if array[i]:
				tmp = i
				while tmp <= n:
					print(tmp, end=' ')
					array[tmp] = False
					tmp *= 2
		print()
main()


class Permutation:

	def findCost(self, n):
		d = 2
		arr = []
		for i in range(1, n // 2 + 1, 2):
			j = i
			while j <= n:
				arr.append(j)
				j *= d
		for i in range(1, n + 1, 2):
			if i > n // 2:
				arr.append(i)
		print(d)
		for i in arr:
			print(i, end=' ')
		print()
		return
T = int(input())
while T:
	T -= 1
	n = int(input())
	Permutation().findCost(n)


T = int(input())
q = []
for i in range(T):
	n = int(input())
	q.append(n)

def solve(n):
	print(2)
	written = [False for _ in range(n + 1)]
	for i in range(1, n + 1):
		if written[i]:
			continue
		print(i, end=' ')
		target = i * 2
		while target <= n:
			print(target, end=' ')
			written[target] = True
			target *= 2
	print()
for n in q:
	solve(n)


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


t = int(input())
for i in range(t):
	num = int(input())
	print(2)
	for i in range(1, num + 1, 2):
		ans = i
		while ans <= num:
			print(ans, end=' ')
			ans *= 2
	print()


for _ in range(int(input())):
	n = int(input())
	print(2)
	for v in range(1, n + 1, 2):
		k = v
		while k <= n:
			print(k, end=' ')
			k *= 2
	print()


for _ in range(int(input())):
	n = int(input())
	mass = []
	print(2)
	for i in range(1, n + 1, 2):
		x = i
		while x <= n:
			print(x, end=' ')
			x *= 2
	print()


y = int(input())
for i in range(y):
	n = int(input())
	d = 2
	print(d)
	for i in range(1, n + 1, d):
		j = i
		while j <= n:
			print(j, end=' ')
			j *= d
	print('')


import sys

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

def si():
	return input()

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

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stout = open('output.txt', 'w')

def main():
	for i in range(ii()):
		n = ii()
		a = [0] * (n + 1)
		print(2)
		for i in range(1, n + 1, 2):
			if a[i] != 1:
				print(i, end=' ')
				k = i * 2
				a[i] = 1
				while k <= n:
					print(k, end=' ')
					a[k] = 1
					k *= 2
			else:
				continue
		print('')
main()


for i in range(int(input())):
	a = int(input())
	print(2)
	b = [0] * (a + 1)
	for j in range(1, a + 1):
		if b[j] == 0:
			d = j
			while d <= a:
				print(d, end=' ')
				b[d] = 1
				d *= 2
	print()


t = int(input())

def solve(n):
	arr = []
	for i in range(1, n + 1, 2):
		temp = []
		x = i
		while x <= n:
			temp.append(x)
			x = x * 2
		for j in temp:
			arr.append(j)
	return arr
while t > 0:
	n = int(input())
	print(2)
	x = solve(n)
	for i in x:
		print(i, end=' ')
	print()
	t = t - 1


import math
t = int(input())
for z in range(t):
	n = int(input())
	print(2)
	l = []
	k = int(math.log2(n))
	for i in range(k + 1):
		print(2 ** i, end=' ')
	for i in range(3, n + 1, 2):
		j = i
		while j <= n:
			print(j, end=' ')
			j = 2 * j
	print()