program D_C;

{$APPTYPE CONSOLE}

Var
  X1, Y1, X2, Y2, K, i: integer;
  L, C: array [1..4] of integer;
  Pipe: array [1..40] of record x, y: integer; end;
  PipeCol, Min: integer;

procedure Add(AX, AY, PL: integer);
var i, j, z: integer;
begin
  for j := -1 to 1 do for i := -1 to 1 do
    if Abs(i) + Abs(j) = 1 then begin
      Inc(PipeCol);
      Pipe[PipeCol].x := AX + i*L[PL];
      Pipe[PipeCol].y := AY + j*L[PL];
      Dec(C[PL]);

      with Pipe[PipeCol] do
	if (x = x2) and (y = y2) then begin
	  if Min > PipeCol then Min := PipeCol;
	end else
	  for z := 1 to K do
	    if C[z] > 0 then
	      Add(x, y, z);

      Inc(C[PL]);
      Dec(PipeCol);
    end;
end;

begin
  Assign(input, 'INPUT.TXT'); Reset(input);
  Read(X1, Y1, X2, Y2, K);
  for i := 1 to K do Read(L[i]);
  for i := 1 to K do Read(C[i]);
  PipeCol :=0; Min := 100000;
  for i := 1 to K do
    if C[i] > 0 then
      Add(X1, Y1, i);
  Assign(output, 'OUTPUT.TXT'); Rewrite(output);
  if Min = 100000 then
    Writeln(-1)
  else
    Writeln(Min);
end.