1369 : n, k = map(int, input().split())
for i in range(n):
for j in range(n):
if i==0 or i==n-1 or (i+j+1)%k==0 or j==0 or j==n-1:
print('*',end='')
else :
print(' ',end='')
print()
1366 : n = int(input())
for i in range(n):
for j in range(n):
if i==0 or i==n-1 or i==j or j+i==n-1 or j==0 or j==n-1 or i==(n-1)/2 or j==(n-1)/2:
print('*',end='')
else :
print(' ',end='')
print()
1365 : n = int(input())
for i in range(n):
for j in range(n):
if i==0 or i==n-1 or i==j or j+i==n-1 or j==0 or j==n-1:
print('*',end='')
else :
print(' ',end='')
print()