uses
  sysutils, tools;

var
  i: integer;

begin
  randseed := 22;
  n := maxn;
  m := maxn;
  for i := 1 to n div 2 do a[i] := i * 2;
  for i := 1 to n div 2 do b[i] := i * 2 - 1;
  for i := 1 to n div 4 do b[i + n div 2] := -i;
  for i := 1 to n div 4 do b[i + n div 2 + n div 4] := n + i;
  for i := 1 to n div 2 do a[i + n div 2] := 2*n + i;
  shuffle;
  done;
end.