The chef is trying to decode 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:-----
0
01
10
012
101
210
0123
1012
2101
3210

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

Difficulty: UNKNOWN_DIFFICULTY

Solutions:
for _ in range(int(input())):
	n = int(input())
	if n == 1:
		print('0')
	else:
		s = []
		for i in range(n):
			s.append(str(i))
		print(''.join(s))
		p = 1
		for i in range(n - 1):
			s.pop(n - 1)
			s = [str(p)] + s
			print(''.join(s))
			p += 1


from sys import stdin, stdout, maxsize
from math import sqrt, log, factorial, gcd
from collections import defaultdict as D
from bisect import insort
for _ in range(int(input())):
	n = int(input()) - 1
	for i in range(n, -1, -1):
		for j in range(n - i, 0, -1):
			print(j, end='')
		for j in range(i + 1):
			print(j, end='')
		print()


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
from collections import Counter as cc
mod = 10 ** 9 + 7
md = 998244353
tc = 1
(tc,) = inp()
for _ in range(tc):
	(n,) = inp()
	a = [[0 for i in range(n)] for j in range(n)]
	for i in range(n):
		for j in range(i + 1, n):
			a[i][j] = a[i][j - 1] + 1
		for j in range(i - 1, -1, -1):
			a[i][j] = a[i][j + 1] + 1
	for i in a:
		print(*i, sep='')


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


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())
	for i in range(n):
		for j in range(n):
			print(abs(i - j), end='')
		print()