program prvizad;
var
a,i,k:integer;
begin
readln(a);
if a = 2 then
begin
writeln("4 1");
writeln("3 2");
end;
if a = 3 then
begin
writeln("6 1 5");
writeln("4 2 3");
end;
if a = 4 then
begin
writeln("8 1 7 2");
writeln("6 3 5 4");
end;
if a = 5 then
begin
writeln("10 1 9 2 8");
writeln("7 3 6 4 5");
end;
end.