program abc(input,output);
var a:array [1..100,1..100] of integer;
i,k,x,y,n,j:integer;
begin
assign(input, 'F.in');
assign(output, 'F.out');
reset (input);
rewrite (output);
read (input, n);
x:=n div 2+1;
y:=n div 2+1;
j:=n div 2+2;
for i:=1 to sqr(n) do
begin
a[y,x]:=i;
{if i=}
{if j=6 then j:=5;}
case k mod 4 of
0: begin
   inc(x);
   if x=y+1 then inc(k);
   end;
   {Vpravo}
1:       begin
        dec(y);
   if y=(n+1)-x then inc(k);
   end;
   {VVerh}
2:   begin
   dec(x);
   if x=y then inc(k);
   end;
   {Vlevo}
3:   begin
inc(j);
   inc(y);
   if y=(n+1)-x then inc(k);
   end;
   {Vniz}
   end;
end;
for i:=1 to n do
begin
for j:=1 to n do
write(output,a[i,j], ' ');
writeln (output);
end;
close (input);
close (output);
end.