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:-----
3
5
3
4

-----Sample Output:-----
1   1
2 2
3
4 4
5   5
1 1
2
3 3
1  1
22
33
4  4

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

Starter code:

Solutions:
t=int(input())
for _ in range(t):
    n=int(input())
    b=1
    if n%2:
        c=n-2
        for j in range(n//2):
            print(" "*j+str(b) +" "*c+ str(b))
            b+=1
            c-=2
        print(" "*(n//2)+str(b)+" "*(n//2))
        b+=1
        c=1
        for j in range(n//2):
            print(" "*(n//2-j-1)+str(b)+" "*c+ str(b))
            b+=1
            c+=2
    else:
        c=n-2
        for j in range(n//2):
            print(" "*j+str(b)+" "*c+str(b))
            b+=1
            c-=2
        c=0
        for j in range(n//2):
            print(" "*(n//2-j-1)+str(b) +" "*c+ str(b))
            b+=1
            c+=2
        
    
        
    
                
    


try:
    t = int(input())
    for a in range(t):
        k = int(input())
        x = 0
        y = k-1
        n = 1
        for i in range(k):
            for j in range(k):
                if (j==x or j==y):
                    print(n,end="")
                else:
                    print(" ",end="")
            x+=1
            y-=1
            n+=1
            print()
except EOFError:
    pass

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):
            if i==j or i+j==n-1:
                print(str(i+1),end="")
            else: print(" ", end="")
        print()

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


for tc in range(int(input())):
    N = int(input())
    ar = [[' '] * N for i in range(N)]

    a = b = 0
    for i in range(N):
        ar[a][b] = str(i + 1)
        a += 1
        b += 1

    a = 0; b = N - 1
    for i in range(N):
        ar[a][b] = str(i + 1)
        a += 1
        b -= 1

    for row in ar:
        print(''.join(row))