
uses
  SysUtils;
var
  i, j, N, R: Integer;
begin
  N := StrToIntDef(ParamStr(1), 1);
  R := StrToIntDef(ParamStr(2), 10);
  RandSeed := 987423;
  Writeln(N);
  j := -R;
  for i := 1 to N do begin
    Inc(j, Random(R div N) + 1);
    Writeln(j, ' ', Trunc(Sqrt(Sqr(R) - Sqr(j))) * (Random(2) * 2 - 1));
  end;
end.
