{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  N_MAX = 100000;
  T_MAX = 1000000;

var
  n,root,i:integer;

begin
  if paramcount<2 then
  begin
    writeln('Too few params');
    halt;
  end;
  randseed:=strtoint(paramstr(1));
  n:=strtoint(paramstr(2));

  root:=random(n)+1;
  writeln(n,' ',n-1);
  for i:=1 to n do
    if i=root then writeln('0 0') else writeln(root,' ',T_MAX-random(100));
end.
