{$ifdef fpc} {$mode delphi} {$endif}
{$apptype console}
{$s-,i-,r-,q-,v-,d-,l-,o+}
const
	filein = 'F.in';
	fileout = 'F.out';
	maxn = 110;
var
	a: array[0..maxn + 1,0..maxn + 1]of longint;
	n,i,j,k,z: longint;

begin
	assign(input,filein);reset(input);assign(output,fileout);rewrite(output);
	read(n); fillchar(a,sizeof(a),0);

	a[n div 2 + 1, n div 2 + 1] := 1;
	i := n div 2 + 1; j := n div 2 + 1; k := 1; z := 2;
	while k < n * n do begin
		inc(k);
		if z = 0 then begin
			dec(j); a[i,j] := k;
			if a[i + 1,j] = 0 then z := 1;
		end else
		if z = 1 then begin
			inc(i); a[i,j] := k;
			if a[i,j + 1] = 0 then z := 2;
		end else
		if z = 2 then begin
			inc(j); a[i,j] := k;
			if a[i - 1,j] = 0 then z := 3;
		end else
		if z = 3 then begin
			dec(i); a[i,j] := k;
			if a[i,j - 1] = 0 then z := 0;
		end;
	end;

	for i := 1 to n do begin
		for j := 1 to n do write(a[i,j],' ');
		writeln;
	end;
	close(output);
end.