{$apptype console}
{$o-,r+,q+}
uses
  sysutils, math;

type
  int = longint;

const
  maxp = 100000;
  maxn = 100;
  maxk = 300;

var
  n : int;
  m : int;
  k : int;
  i : int;

function randP() : int;
begin
  result := random(maxp + 1);
end;

begin
	
  randseed := strtoint(paramstr(1));

  n := 1 + random(maxn);
  m := 1 + random(n);
  k := random(maxk + 1);

  writeln(n, ' ', m, ' ', k);
  for i := 1 to n do
  begin
    writeln(randP(), ' ', randP(), ' ', randP(), ' ', randP(), ' ', randP(), ' ', randP());
  end;
  
end.