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
21
*1
321
*21
**1
4321
*321
**21
***1

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

Difficulty: interview

Starter code:

Solutions:
for _ in range(int(input())):
    n = int(input())
    s = [str(i) for i in range(n,0,-1)]
    for i in range(n):
        print('*'*i+''.join(s))
        del(s[0])

for i in range(int(input())):
    p=int(input())
    for i in range(p):
        for k in range(i):
            print("*", end="")
        for j in range(i,p):
            print(p-j, end="")
        print()
            

try:
	for _ in range(int(input())):
		n=int(input())
		L=[*map(lambda i: str(i), range(n,0,-1))]
		print("".join(L))
		for i in range(len(L)-1):
			L[i]="*"
			print("".join(L))
except: pass

try:
	for _ in range(int(input())):
		n=int(input())
		L=[*[str(i) for i in range(n,0,-1)]]
		print("".join(L))
		for i in range(len(L)-1):
			L[i]="*"
			print("".join(L))
except: pass


from sys import*
input=stdin.readline
t=int(input())
for _ in range(t):
    n=int(input())
    c=0
    for i in range(n):
        d=c
        for j in range(n,0,-1):
            if d>0:
                print("*",end="")
                d-=1
            else:
                print(j,end="")
        c+=1
        print()


# cook your dish here
t=int(input())
for i in range(t):
    n=int(input())
    if(n==1):
        print(1)
    else:
        a=""
        l=0
        for k in range(n):
            a=""
            a=a+'*'*l
            for j in range(n-l,0,-1):
                a=a+str(j)
            l+=1
            print(a)

# cook your dish here
t=int(input())
while(t>0):
    n=int(input())
    c=0
    for i in range(1,n+1):
        print('*'*c,end='')
        for j in range(n-i+1,0,-1):
            print(j,end='')
        c=c+1
        print()
    t=t-1

for _ in range(int(input())):
    n = int(input())
    if n == 1:
        print(1)
        continue
    ans = ""
    ctr = 0
    for i in range(n):
        ans = ""
        for j in range(ctr):
            ans+='*'
        for j in range(n - ctr, 0, -1):
            ans += str(j)
        print(ans)
        ctr += 1


# cook your dish here
t=int(eval(input("")))
while(t!=0):
    k=int(eval(input("")))
    s=''
    for i in range(k,0,-1):
        #print(i)
        for j in range(k,0,-1):
            if i>=k and j==i:
                s=s+str(j)
                continue
            if i<k and j>i:
                s=s+'*'
            else:
                s=s+str(j)
        print(s)
        s=''
    t-=1


# cook your dish here

for _ in range(int(input())):
    k=int(input())
    for i in range(k):
        print('*'*i,end='')
        for j in range(k-i,0,-1):
                print(j,end="")
        print()

# cook your dish here
for a0 in range(int(input())):
    n = int(input())
    l = []
    for i in range(1,n+1):
        l.append(str(i))
    l = l[::-1]
    s = ""
    for i in l:
        s+=i
    print(s)
    i = 0
    while len(set(l))>2 or "2" in l:
        l[i] = "*"
        s = ""
        for j in l:
            s+=j
        print(s)
        
        i+=1
        
        


# cook your dish here

t = int(input())

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


# cook your dish here
t=int(input())
for i in range(0,t):
    my_inp = int(input().strip())
    for abc in range(my_inp):
        for xyz in range(1,abc+1):
            print('*',end="")
        for xyz in range(my_inp-abc):
            print(my_inp-abc-xyz,end="")

        print()

# cook your dish here
def solve():
    n=int(input())
    i=0
    while i<n:
        j=n-i
        for l in range(i):
            print("*",end="")
        while(j>=1):
            print(j,end="")
            j-=1
        print()    
        
        i+=1    

t=int(input())
i=0
while(i<t):
    solve()
    i+=1

for _ in range(int(input())):
    n=int(input())
    for _ in range(n,0,-1):
        x=_
        print('*'*(n-_),end="")
        for _ in range(x):
            print(x-_,end="")
        print()    
        

for u in range(int(input().strip())):
    n = int(input().strip())
    for i in range(n):
        for space in range(1,i+1):
            print('*',end="")
        for j in range(n-i):
            print(n-i-j,end="")
        
        print()

def solve():
    n=int(input())
    i=0
    while i<n:
        j=n-i
        for l in range(i):
            print("*",end="")
        while(j>=1):
            print(j,end="")
            j-=1
        print()    
        
        i+=1    

t=int(input())
i=0
while(i<t):
    solve()
    i+=1# cook your dish here


# cook your dish here
for i in range(int(input())):
  n = int(input())
  for i in range(n,0,-1):
    temp = i
    val = n-temp
    while(val!=0):
      print("*",end="")
      val-=1
    
    while(temp!=0):
        print(temp,end="")
        temp-=1
    
    print()

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


for i in range(int(input())):
    s=int(input())
    for i in range(s):
        for k in range(i):
            print("*", end="")
        for j in range(i,s):
            print(s-j, end="")
        print()# cook your dish here


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

n=int(input())
for i in range(n):
    a=int(input())
    for j in range(a,0,-1):
        for k in range(a-j):
            print("*",end="")
        for k in range(j,0,-1):
            print(k,end="")
        print()

# cook your dish here
for _ in range(int(input())):
    n=int(input())
    for i in range(1,n+1):
        for j in range(1,i):
            print("*",end="")
        for j in range(n-i+1,0,-1):
            print(j,end="")


        print()