uses
  sysutils, tools;

var
  i: integer;

begin
  randseed := 16;
  for i := 1 to 2*maxn do a[i] := random(maxt + 1);
  sort(a, 1, 2*maxn);
  for i := 1 to maxn do b[i] := a[i];
  for i := 1 to maxn do a[i] := a[i + maxn];
  n := maxn;
  m := maxn;
  shuffle;
  done;
end.