The chef is trying to solve some pattern problems, Chef wants your help to code it. Chef has one number K(odd) 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 50$
- $1 \leq K \leq 50$

-----Sample Input:-----
4
1
3
5
7

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

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

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
def func(num):
	for i in range(num):
		if i < num // 2 + 1:
			print(' ' * i, end='')
			print('*')
		else:
			print(' ' * (num - i - 1), end='')
			print('*')
for _ in range(int(input())):
	num = int(input())
	func(num)


T = int(input())
for _ in range(T):
	K = int(input())
	V = (K + 1) // 2
	for i in range(1, V + 1):
		line = ''
		for j in range(1, i + 1):
			if j == i:
				line = line + '*'
			else:
				line = line + ' '
		print(line)
	for i in range(V - 1, 0, -1):
		line = ''
		for j in range(1, i + 1):
			if j == i:
				line = line + '*'
			else:
				line = line + ' '
		print(line)


t = int(input())
while t:
	n = int(input())
	p = int(n / 2)
	p = p + 1
	for i in range(0, p):
		for j in range(0, i):
			if j >= 0:
				print(end=' ')
		print('*')
	p = p - 2
	for i in range(p, 0, -1):
		for j in range(0, i):
			print(end=' ')
		print('*')
	if n > 1:
		print('*')
	t = t - 1


for _ in range(int(input())):
	n = int(input())
	x = 0
	for _ in range(1, n + 1):
		if _ <= (n + 1) // 2:
			print(' ' * x, end='')
			print('*')
			x += 1
		else:
			if _ == (n + 1) // 2 + 1:
				x = x - 2
			print(' ' * x, end='')
			print('*')
			x -= 1


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


for i in range(int(input())):
	n = int(input())
	a = n // 2 + 1
	l = a - 2
	for j in range(1, a + 1):
		space = j - 1
		print(' ' * space, end='')
		print('*')
	for j in range(a + 1, n + 1):
		space = l
		print(' ' * space, end='')
		print('*')
		l -= 1


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


def solve():
	n = int(input())
	k = n // 2
	for i in range(n):
		j = 0
		if i <= k:
			z = i
		else:
			z = n - i - 1
		while j != z:
			print(' ', end='')
			j += 1
		print('*')

def __starting_point():
	T = int(input())
	for i in range(T):
		solve()
__starting_point()


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


def solve(n):
	if n == 1:
		print('*')
		return
	s = 0
	ms = n // 2
	o = 1
	for i in range(n):
		if s == ms:
			o = -1
		x = '*'
		x = x.rjust(1 + s)
		s += o
		print(x)

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		solve(n)
main()


for _ in range(int(input())):
	n = int(input())
	for i in range(n):
		if i < n // 2:
			print(' ' * i, end='')
		else:
			print(' ' * (n - i - 1), end='')
		print('*')


def f(n):
	if n == 1:
		print('*')
		return
	if n == 2:
		print('*')
		print('*')
		return
	k = n // 2
	j = 2
	print('*')
	while j <= k:
		print(j * ' ' + '*')
		j += 1
	while j > 1:
		print(j * ' ' + '*')
		j -= 1
	print('*')
	return
t = int(input())
for i in range(t):
	n = int(input())
	f(n)


def f(n):
	k = (n + 1) // 2
	line = lambda i: print(' ' * (i - 1) + '*')
	for i in range(1, k + 1):
		line(i)
	i = k - 1
	while i > 0:
		line(i)
		i -= 1
t = int(input())
questions = list()
for _ in range(t):
	n = int(input())
	questions.append(n)
for question in questions:
	f(question)


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	k = 0
	for i in range(n // 2 + 1):
		for i in range(k):
			print(' ', end='')
		print('*')
		k = k + 1
	k = k - 2
	for i in range(n // 2):
		for i in range(k):
			print(' ', end='')
		print('*')


t = int(input())
for _ in range(t):
	n = int(input())
	k = n // 2 + 1
	ans = [[' ' for i in range(k)] for j in range(n)]
	for i in range(k):
		ans[i][i] = '*'
	c = k - 2
	for i in range(k, n):
		ans[i][c] = '*'
		c -= 1
	for i in range(n):
		for j in range(k):
			print(ans[i][j], end=' ')
		print()


for _ in range(int(input())):
	n = int(input())
	for i in range((n + 1) // 2):
		for j in range(i):
			print(end=' ')
		print('*\r')
	for i in range(n // 2 - 1, -1, -1):
		for j in range(i):
			print(end=' ')
		print('*\r')


t = int(input())
while t:
	n = int(input())
	for i in range(1, n + 1):
		if i == 1 or i == n:
			print('*')
			continue
		print(' ' * min(i - 1, n - i) + '*')
	t -= 1


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


t = int(input())
for _ in range(t):
	k = int(input())
	for i in range(k):
		for j in range(int(k / 2) + 1):
			if i <= j:
				if i == j:
					print('*', end='')
				elif i < j:
					print(' ', end='')
			elif i + j == k - 1:
				print('*', end='')
			elif i > j:
				print(' ', end='')
		print()


for _ in range(int(input())):
	n = int(input())
	r = (n + 1) // 2
	dr = []
	for i in range(r):
		t = ' ' * i + '*'
		dr.append(t)
	for i in range(r):
		print(dr[i])
	for i in range(r - 2, -1, -1):
		print(dr[i])


t = int(input())
for _ in range(t):
	k = int(input())
	i = 0
	l = k - 1
	for j in range(k):
		print(' ' * min(i, l) + '*')
		i += 1
		l -= 1


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda : list(map(int, sys.stdin.readline().rstrip('\r\n').split()))
tc = 1
(tc,) = inp()
for _ in range(tc):
	(n,) = inp()
	for i in range(n // 2):
		print(' ' * i + '*')
		print()
	print(' ' * (n // 2) + '*')
	for i in range(n // 2 - 1, -1, -1):
		print()
		print(' ' * i + '*')


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 and i == j:
				print('*', end='')
			else:
				print(' ', end='')
		print()