{$apptype console}

uses 
  SysUtils;

{$I gens.inc}

var
  i, j: integer;
begin
  writeln(MAXD, ' ', MAXN);
  for i := 1 to MAXN - 1 do begin
    write(100);
    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(' ', 2);
  write(' ', 1);
  for j := 1 to MAXD do
    write(' ', 1);
end.