def issyuu(start,nagasa,syokiiti,gyouretu): #(一周分の動き)start:はじめの値、nagasa:直進の長さ、syokiiti:座標(0,0)で0,(1,1)で1 for i in range(nagasa):#右方向 gyouretu[syokiiti][syokiiti + i] = start start += 1 for i in range(nagasa - 1):#下方向 gyouretu[syokiiti + i + 1][syokiiti + nagasa - 1] = start start += 1 for i in range(nagasa - 1):#左方向 gyouretu[syokiiti + nagasa - 1][syokiiti + nagasa - 2 - i] = start start += 1 for i in range(nagasa - 2):#上方向 gyouretu[syokiiti + nagasa - 2 - i][syokiiti] = start start += 1 return gyouretu N = int(input()) na = N gy = [[1 for i in range(na)] for j in range(na)] st = 1 sy = 0 for j in range((N+1)//2): issyuu(st,na,sy,gy) #以下、二週めの準備 print(st,na,sy) st += 4*na - 4 na = na - 2 sy += 1 print(st,na,sy) #作成した行列を表示する for k in range(N): for l in range(N): if len(str(gy[k][l]))==1: gy[k][l] = "00"+str(gy[k][l]) elif len(str(gy[k][l]))==2: gy[k][l] = "0"+str(gy[k][l]) else: gy[k][l] = str(gy[k][l]) print(gy[k][l],end=" ") print() print()