program zhunbeigongzuo;
var
n,i:longint;
p,r,d:array[1..100]of longint;
biaozhi:array[1..100]of boolean;
min,max,s:longint;
jilu,a:array[1..100]of longint;
function da(x,y:longint):longint;
begin
if x>y then
da:=x
else
da:=y
end;
procedure sousuo(k,time:longint);
var
i:longint;
begin
if k>n then
begin
max:=0;
for s:=1 to n do
begin
if jilu[s]+p[a[s]]-d[a[s]]>max then
max:=jilu[s]+p[a[s]]-d[a[s]]
end;
if max<min then
min:=max
end
else
begin
for i:=1 to n do
begin
if biaozhi[i] then
begin
a[k]:=i;
jilu[k]:=da(time,r[i]);
biaozhi[i]:=false;
sousuo(k+1,jilu[k]+p[i]);
biaozhi[i]:=true
end
end
end
end;
begin
assign (input,'preparation.in');
reset (input);
assign (output,'preparation.out');
rewrite (output);
readln (n);
while n<>0 do
begin
for i:=1 to n do
read (p[i]);
readln;
for i:=1 to n do
read (r[i]);
readln;
for i:=1 to n do
read (d[i]);
readln;
for i:=1 to n do
biaozhi[i]:=true;
min:=maxlongint;
sousuo(1,0);
writeln (min);
readln(n)
end;
close (input);
close (output)
end.