const
maxN = 10;
var
a: array [0 .. maxN - 1, 0 .. maxN - 1] of Integer;
n, hn, i, j, x, y: Integer;
f: Text;
begin
Assign(f, 'CON');
Reset(f);
ReadLn(f, n);
Close(f);
Assign(f, 'CON');
Rewrite(f);
if n = 2 then
begin
Write(f, 'No solution');
Close(f);
Halt(0);
end;
hn := n div 2;
for i := 0 to n - 1 do
for j := 0 to n - 1 do
begin
x := i + j - hn;
y := i - j + hn;
if x < 0 then
inc(x, n)
else if x >= n then
dec(x, n);
if y < 0 then
inc(y, n)
else if y >= n then
dec(y, n);
a[y][x] := i * n + j + 1;
end;
for y := 0 to n - 1 do
begin
for x := 0 to n - 1 do
Write(f, a[y][x], ' ');
WriteLn(f);
end;
Close(f);
end.