{$q+,r+,o-}

uses sysutils;

var
  i, j, n, t: integer;
  q, p, d: array[1..1000] of integer;

begin
  n := 1000;

  writeln(1000, ' ', 1000000000);

  for i := 1 to n do q[i] := i * 1000000;
  for i := 2 to n do begin
    j := random(i) + 1;
    t := q[i];
    q[i] := q[j];
    q[j] := t;
  end;
  for i := 1 to n do begin
    write(q[i]);
    if (i < n) then write(' ') else writeln;
  end;

  for i := 1 to n do q[i] := i * 1000000;
  for i := 2 to n do begin
    j := random(i) + 1;
    t := q[i];
    q[i] := q[j];
    q[j] := t;
  end;
  for i := 1 to n do begin
    write(q[i]);
    if (i < n) then write(' ') else writeln;
  end;

  for i := 1 to n do q[i] := i * 1000000;
  for i := 2 to n do begin
    j := random(i) + 1;
    t := q[i];
    q[i] := q[j];
    q[j] := t;
  end;
  for i := 1 to n do begin
    write(q[i]);
    if (i < n) then write(' ') else writeln;
  end;
end.