The chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K to form a new pattern. Help the chef to code this pattern problem.

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, one integer $K$. 

-----Output:-----
For each test case, output as the pattern.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq K \leq 100$

-----Sample Input:-----
4
1
2
3
4

-----Sample Output:-----
1 
1 10 
11 100 
1 10 11 
100 101 110 
111 1000 1001 
1 10 11 100 
101 110 111 1000 
1001 1010 1011 1100 
1101 1110 1111 10000 

-----EXPLANATION:-----
No need, else pattern can be decode easily.

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
t = int(input())
for _ in range(t):
	k = int(input())
	count = 1
	for _ in range(k):
		output = []
		for index in range(1, k + 1):
			output.append(bin(count).replace('0b', ''))
			count += 1
		print(*output)


for _ in range(int(input())):
	k = int(input())
	x = 1
	for i in range(k):
		for j in range(k):
			print('{0:b}'.format(x), end=' ')
			x = x + 1
		print()


def solve(n):
	k = 1
	for i in range(n):
		for j in range(n):
			print(bin(k).replace('0b', ''), end=' ')
			k += 1
		print()
for _ in range(int(input())):
	n = int(input())
	solve(n)


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


t = int(input())
while t:
	n = int(input())
	k = 1
	for i in range(1, n + 1):
		for j in range(1, n + 1):
			print(bin(k)[2:], end=' ')
			k += 1
		print()
	t -= 1


for _ in range(int(input())):
	n = int(input())
	c = 1
	for i in range(0, n):
		for j in range(0, n):
			print(bin(c).replace('0b', ''), end=' ')
			c += 1
		print()


t = int(input())
while t:
	n = int(input())
	cnt = 1
	for i in range(1, n + 1):
		s = ''
		for j in range(1, n + 1):
			s = s + str(bin(cnt))[2:] + ' '
			cnt = cnt + 1
		print(s)
	t = t - 1


try:

	def solve(n):
		res = ''
		while n != 0:
			if n % 2 == 0:
				res = '0' + res
			else:
				res = '1' + res
			n >>= 1
		return res
	t = int(input())
	for _ in range(t):
		n = int(input())
		c = 1
		for i in range(n):
			for j in range(n):
				z = solve(c)
				c += 1
				print(z, end=' ')
			print()
except EOFError:
	pass


for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('1')
	else:
		p = 1
		for i in range(n):
			for j in range(n):
				print(str(bin(p)).replace('0b', ''), ' ', end='')
				p += 1
			print()


for no in range(int(input())):
	n = int(input())
	a = 1
	for i in range(n):
		for j in range(n):
			print(bin(a)[2:], end=' ')
			a += 1
		print()


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


def decimalToBinary(n):
	return bin(n).replace('0b', '')
for tt in range(int(input())):
	n = int(input())
	cnt = 1
	for i in range(n):
		for j in range(n):
			s = decimalToBinary(cnt)
			print(s, end=' ')
			cnt += 1
		print()


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
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
mod = pow(10, 9) + 7
mod2 = 998244353

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

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(n, val) for j in range(m)]

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

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

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
for _ in range(int(inp())):
	n = int(inp())
	c = 1
	for i in range(n):
		for j in range(n):
			print(bin(c)[2:], end=' ')
			c += 1
		print()


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