program test
implicit none
integer::k,l,m,i,s
integer::ans=1000000
integer,allocatable::a(:),b(:),c(:),x(:),y(:)
read(5,*),k,l,m
allocate(a(k))
allocate(b(l))
allocate(c(m))
allocate(x(m))
allocate(y(m))
 
	read(5,*)(a(i),i=1,k)
	read(5,*)(b(i),i=1,l)
 	read(5,*)(x(i),y(i),c(i),i=1,m)
    
do i=1,m 
    s=a(x(i))+b(y(i))-c(i)
    ans=min(s,ans)
end do 
 
ans=min(minval(a)+minval(b),ans)
print*,ans
end program test