program _________c;
 var
     f:text;
     i,j,k,M,N:longint;
     L,C:array[1..4]of longint;
     x1,x2,y1,y2,min:longint;
     xx1,xx2,xx3,xx4,yy1,yy2,yy3,yy4:longint;

 begin
   min:=maxlongint;
   fillchar(C,sizeof(C),0);
   assign(f,'input.txt');
   reset(f);
   read(f,x1,y1,x2,y2,k);
   for i:=1 to k do read(f,L[i]);
   for i:=1 to k do read(f,C[i]);
   close(f);

   xx1:=0;xx2:=0;xx3:=0;xx4:=0;
   yy1:=0;yy2:=0;yy3:=0;yy4:=0;


   if (y2-y1)=0 then
   begin
     for xx1:=-C[1] to C[1] do if min<abs(xx1) then continue else
       for xx2:=-C[2] to C[2] do if min<abs(xx2)+abs(xx1) then continue else
         for xx3:=-C[3] to C[3] do if min<abs(xx2)+abs(xx1)+abs(xx3) then continue else
           for xx4:=-C[4] to C[4] do if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4) then continue else
            begin
              if (xx1*l[1]+xx2*l[2]+xx3*l[3]+xx4*l[4])=(x2-x1) then
                if (abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4))<min then
                   min:=(abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4));
            end;
   end else begin
     if (x2-x1)=0 then
     begin
       for xx1:=-C[1] to C[1] do if min<(abs(xx1)) then continue else
         for xx2:=-C[2] to C[2] do if min<(abs(xx2)+abs(xx1)) then continue else
           for xx3:=-C[3] to C[3] do if min<(abs(xx2)+abs(xx1)+abs(xx3)) then continue else
             for xx4:=-C[4] to C[4] do if min<(abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4)) then continue else
              begin
                if (xx1*l[1]+xx2*l[2]+xx3*l[3]+xx4*l[4])=(y2-y1) then
                  if (abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4))<min then
                     min:=(abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4));
              end;
     end else begin
       for xx1:=-C[1] to C[1] do if min<abs(xx1) then continue else
         for xx2:=-C[2] to C[2] do if min<abs(xx2)+abs(xx1) then continue else
           for xx3:=-C[3] to C[3] do if min<abs(xx2)+abs(xx1)+abs(xx3) then continue else
             for xx4:=-C[4] to C[4] do if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4) then continue else
              begin
                if (xx1*l[1]+xx2*l[2]+xx3*l[3]+xx4*l[4])=(x2-x1) then
                  for yy1:=-C[1] to C[1] do if (abs(xx1)+abs(yy1))<=C[1] then if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4)+abs(yy1) then continue else
                    for yy2:=-C[2] to C[2] do if (abs(xx2)+abs(yy2))<=C[2] then if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4)+abs(yy2)+abs(yy1) then continue else
                      for yy3:=-C[3] to C[3] do if (abs(xx3)+abs(yy3))<=C[3] then if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4)+abs(yy2)+abs(yy3)+abs(yy1) then continue else
                        for yy4:=-C[4] to C[4] do if (abs(xx4)+abs(yy4))<=C[4] then if min<abs(xx2)+abs(xx1)+abs(xx3)+abs(xx4)+abs(yy4)+abs(yy3)+abs(yy2)+abs(yy1) then continue else
                         begin
                           if (yy1*l[1]+yy2*l[2]+yy3*l[3]+yy4*l[4])=(y2-y1) then
                            begin
                              if (abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4)+abs(yy1)+abs(yy2)+abs(yy3)+abs(yy4))<min then
                                  min:=(abs(xx1)+abs(xx2)+abs(xx3)+abs(xx4)+abs(yy1)+abs(yy2)+abs(yy3)+abs(yy4));
                            end;
                         end;
              end;
     end;
   end;



{           for yy1:=-C[1] to C[1] do if (abs(xx1)+abs(yy1))<C[1] then
             for yy2:=-C[1] to C[1] do if (abs(xx2)+abs(xx2))<C[1] then}

   assign(f,'output.txt');
   rewrite(f);
   if min=maxlongint then write(f,'-1') else write(f,min);
   close(f);
 end.
