program problem_c;

{$APPTYPE CONSOLE}

type
  Tce =array[1..4] of byte;

var
 f:TextFile;
 i,x1,y1,x2,y2,k:integer;
 l: array[1..4] of integer;
 c : Tce;
 R:Integer;
 ll:byte;


 procedure Rec(x,y:integer;c1,c2,c3,c4,all:byte);
 begin
   if (x<1)or(y<1)or(x>1000)or(y>1000) then exit;
   if (x=x2)and(y=y2) then begin if ll-all<r then r:=ll-all; exit; end;
   if all=0 then exit;
if k>=1 then
                begin
                   if c1>0 then
                   begin
                     rec(x+l[1],y,c1-1,c2,c3,c4,all-1);
                     rec(x,y+l[1],c1-1,c2,c3,c4,all-1);
                     rec(x-l[1],y,c1-1,c2,c3,c4,all-1);
                     rec(x,y-l[i],c1-1,c2,c3,c4,all-1);
                   end;
                end;

if k>=2 then
                begin
                  if c2>0 then
                  begin
                    rec(x+l[2],y,c1,c2-1,c3,c4,all-1);
                    rec(x,y+l[2],c1,c2-1,c3,c4,all-1);
                    rec(x-l[2],y,c1,c2-1,c3,c4,all-1);
                    rec(x,y-l[2],c1,c2-1,c3,c4,all-1);
                  end;
                end;

if k>=3 then
                begin
                  if c3>0 then
                  begin
                    rec(x+l[3],y,c1,c2,c3-1,c4,all-1);
                    rec(x,y+l[3],c1,c2,c3-1,c4,all-1);
                    rec(x-l[3],y,c1,c2,c3-1,c4,all-1);
                    rec(x,y-l[3],c1,c2,c3-1,c4,all-1);
                  end;
                end;

if k=4 then
                begin
                  if c4>0 then
                  begin
                    rec(x+l[4],y,c1,c2,c3,c4-1,all-1);
                    rec(x,y+l[4],c1,c2,c3,c4-1,all-1);
                    rec(x-l[4],y,c1,c2,c3,c4-1,all-1);
                    rec(x,y-l[4],c1,c2,c3,c4-1,all-1);
                  end;
                end;

end;

begin
r:=32000;
for i:=1 to 4 do
  begin
    c[i]:=0;
    l[i]:=0;
  end;
 assignfile(f,'input.txt');
 reset(f);
 read(f,x1,y1,x2,y2,k);
 ll:=0;
 for i:=1 to k do read(f,l[i]);
 for i:=1 to k do read(f,c[i]);
 for i:=1 to k do inc(ll,c[i]);
 closefile(f);
 Rec(x1,y1,c[1],c[2],c[3],c[4],ll);
 assignfile(f,'output.txt');
 rewrite(f);
 if r=32000 then r:=-1;
// if r=0 then r:=-1;
 write(f,r);
 closefile(f);
end.
