program ccc;
{$APPTYPE CONSOLE}
var x1,y1,x2,y2:integer;
    L,C,m1,m2:array[1..4] of integer;
    bestcount:integer=1000000;
    i1,i2,i3,i4:integer;
procedure DoInput;
var i,k:integer;
begin
  AssignFile(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]);
  CloseFile(input);
end;
procedure perebor(dy,d1,d2,d3,d4,count:integer);
var
  count2:integer;
begin
  count2:=1000;
(*  if x1-x2=0 then begin
  for i1:=0 to d1 do
  for i2:=0 to d2 do
  for i3:=0 to d3 do
  for i4:=0 to d4 do
   if dy+L[1]*i1+L[2]*i2+L[3]*i3+L[4]*i4=0 then
   begin
     if count+abs(i1)+abs(i2)+abs(i3)+abs(i4)<bestcount then
     begin
       bestcount:=count+abs(i1)+abs(i2)+abs(i3)+abs(i4);
{       count2:=abs(i1)+abs(i2)+abs(i3)+abs(i4);
       m1[1]:=i1;
       m1[2]:=i2;
       m1[3]:=i3;
       m1[4]:=i4;}
     end;
   end;

{  dec(c[1],abs(m1[1]));
  dec(c[2],abs(m1[2]));
  dec(c[3],abs(m1[3]));
  dec(c[4],abs(m1[4]));
  count:=count+count2;}

  end else begin*)
  for i1:=-d1 to d1 do
  for i2:=-d2 to d2 do
  for i3:=-d3 to d3 do
  for i4:=-d4 to d4 do
   if dy+L[1]*i1+L[2]*i2+L[3]*i3+L[4]*i4=0 then
   begin
     if count+abs(i1)+abs(i2)+abs(i3)+abs(i4)<bestcount then
     begin
       bestcount:=count+abs(i1)+abs(i2)+abs(i3)+abs(i4);
{       count2:=abs(i1)+abs(i2)+abs(i3)+abs(i4);
       m1[1]:=i1;
       m1[2]:=i2;
       m1[3]:=i3;
       m1[4]:=i4;}
     end;
   end;
{  dec(c[1],abs(m1[1]));  dec(c[2],abs(m1[2])); dec(c[3],abs(m1[3]));
  dec(c[4],abs(m1[4]));
  count:=count+count2;}
(*  end;*)
end;
begin
  DoInput;
  if abs(x1-x2)=0 then begin
    for i1:=0 to c[1] do
    for i2:=0 to c[2] do
    for i3:=0 to c[3] do
    for i4:=0 to c[4] do
     if abs(x1-x2)+L[1]*i1+L[2]*i2+L[3]*i3+L[4]*i4=0 then
     begin
       perebor(y1-y2,c[1]-abs(i1),c[2]-abs(i2),c[3]-abs(i3),c[4]-abs(i4),
       abs(i1)+abs(i2)+abs(i3)+abs(i4));
     end;

  end else begin
  for i1:=-c[1] to c[1] do
  for i2:=-c[2] to c[2] do
  for i3:=-c[3] to c[3] do
  for i4:=-c[4] to c[4] do
   if abs(x1-x2)+L[1]*i1+L[2]*i2+L[3]*i3+L[4]*i4=0 then
   begin
     perebor(y1-y2,c[1]-abs(i1),c[2]-abs(i2),c[3]-abs(i3),c[4]-abs(i4),
       abs(i1)+abs(i2)+abs(i3)+abs(i4));
   end;

  end;



  AssignFile(output,'output.txt');
  Rewrite(output);
  if bestcount<100000 then
    Write(bestcount)
  else
    write(-1);
  CloseFile(output);
end.
