{$apptype console}

{$I gens.inc}

var
  i, j: integer;
begin
  writeln(MAXD, ' ', MAXN_ODD);
  for i := 1 to MAXN_ODD div 2 do begin
    write(i);
    for j := 1 to MAXD do 
      write(' ', 2);
    for j := 1 to MAXD - 1 do 
      write(' ', 0);
    write(' ', 1);
    writeln;
  end;

  write(10000, ' ');
  for j := 1 to MAXD - 1 do 
    write(' ', 0);
  write(' ', 1);
  write(' ', 1);
  for j := 1 to MAXD - 1 do 
    write(' ', 0);
  writeln;

  for i := MAXN_ODD div 2 + 2 to MAXN_ODD do begin
    write((i - MAXN_ODD div 2 - 1));
    write(' ', 1);
    for j := 1 to MAXD - 1 do 
      write(' ', 2);
    for j := 1 to MAXD do 
      write(' ', 1);
    writeln;
  end;
end.