e=int(input())
sqr=[[0 for x in range(e)] for x in range(e)]
for i in range(e):
for j in range(e):
if i == 0 or i == e-1 or i == j or j == 0 or j == e-1:
sqr[i][j] = "*"
else:
sqr[i][j] = " "
for edges in sqr:
for rows in edges:
print(rows,end=" ")
print()