感觉很难
while 1:
try:
n = int(input())
for i in range(0,n):
for j in range(0,n):
if i==0 or i ==n-1:
print("* ",end="")
elif j==0 or j==n-1:
print("* ",end="")
else:
print(" ",end="")
print()
except:
break