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

-----Sample Output:-----
*
*
**
*
**
***
*
**
* *
****
*
**
* *
*  *
*****

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

Starter code:

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

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

def solve():
    n=int(input())
    i=0
    while i<n-1:
        if i==0:
            print("*",end="")
        else:
            print("*",end="")
            for k in range(i-1):
                print(" ",end="")
            print("*",end="")
        print()    
        i+=1    
    for i in range(n):
        print("*",end="")
    print()    

t=int(input())
i=0
while(i<t):
    solve()
    
    i+=1

t=int(input())
for _ in range(t):
    n=int(input())
    for i in range(n):
        if i==n-1:
            print('*'*(i+1))
        else:
            if i==0:
                print('*')
            else:
                print('*'+" "*(i+1-2)+'*')
    
    
    
        
    
                
    


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


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

for _ in range(int(input())):
    n=int(input())
    a=0
    if n==1:
        print('*')
    elif n==2:
        print('*')
        print('**')
    else:    
        print('*')
        for _ in range(2,n):
            print('*',end="")
            if a>0:
                print(' '*a,end="")
            a+=1    
            print('*')
        print('*'*n)    

n = int(input())
while(n>0):
    n-=1
    a = int(input())
    print("*")
    for i in range(2,a):
        print("*", end='')
        print(" "*(i-2), end='')
        print("*")
    if(a!=1):
        print("*"*a)



n = int(input())
while(n>0):
    n-=1
    a = int(input())
    print("*")
    for i in range(2,a):
        print("*", end='')
        print(" "*(i-2), end='')
        print("*")
    if(a!=1):
        print("*"*a)



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


for _ in range(int(input())):
    n = int(input())
    print("*")
    for i in range(2, n):
        print("*" + " " * (i - 2) + "*")
    if n > 1:
        print(n * "*")

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

try:
    t = int(input())
    for a in range(t):
        k = int(input())
        for i in range(k):
            # for j in range(k):
            if (i==0 or i==k-1):
                print("*"*(i+1))
            else:
                print("*"+(" "*(i-1))+"*")
except EOFError:
    pass

#Pattern I
T = int(input())

for t in range(T):
    N = int(input())
    
    for i in range(N):
        if(i==0):
            print("*")
        elif(i==(N-1)):
            print("*"*N)
        else:
            print("*"+" "*(i-1)+"*")

t=int(input())
for i in range(t):
    k=int(input())
    m=0
    for j in range(1,k+1):
        for m in range(1,k+1):
            if j==k:
                print("*",end="")
            else:
                if m==1 or m==j:
                    print("*",end="")
                else:
                    print(" ",end="")
        print()

for tc in range(int(input())):
    K = int(input())
    for i in range(K):
        ar = []
        for j in range(i + 1):
            if i == K - 1 or j == 0 or j == i:
                ar.append('*')
            else:
                ar.append(' ')
        print(''.join(ar))

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 j>i: continue
            elif i>j and j!=0 and j!=n-1 and i!=0 and i!=n-1: print(" ", end="")
            else: print("*", end="")
        print()

# cook your dish here
for a0 in range(int(input())):
    n=int(input())
    if n==1:
        print("*")
    elif n==2:
        print("*")
        print("**")
    elif n==3:
        print("*")
        print("**")
        print("***")
    else:
        print("*")
        print("**")
        for i in range(3,n):
            s=" "*(i-2)
            print("*"+s+"*")
        print("*"*n)


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