{$APPTYPE CONSOLE}

Uses
  SysUtils;

var
  maxn, maxa, maxd, maxp : int64;

  problems: array [1 .. 100000, 1 .. 2] of int64;
  i, n: integer;
  A: int64;

procedure swap(i, j: integer);
var
  t: int64;
begin
  t := problems[i, 1]; problems[i, 1] := problems[j, 1]; problems[j, 1] := t;
  t := problems[i, 2]; problems[i, 2] := problems[j, 2]; problems[j, 2] := t;
end;

procedure sort(l, r: integer);
var
  i, j: integer;
  x : int64;
begin
  i := l; j := r;
  while i < j do begin
    x := problems[random(r - l + 1) + l, 2];
    while problems[i, 2] < x do inc(i);
    while problems[j, 2] > x do dec(j);
    if i <= j then begin
      swap(i, j);
      inc(i); dec(j);
    end;
  end;
  if i < r then sort(i, r);
  if l < j then sort(l, j);
end;

begin
  //rewrite(output, 'output.txt');
  n := 100000;
  A := 1;
  maxd := 15;
  maxp := 15;
  randomize;
  for i := 1 to n do begin
    problems[i, 1] := n - i + 1;
    problems[i, 2] := random(1000000000);
  end;
  //sort(1, n);
  writeln(n, ' ', A);
  for i := 1 to n do
    writeln(problems[i, 1], ' 1');
end.
