program test
implicit none
integer::k,l,m,i,s
integer::ans=1000000
integer,allocatable::a(:),b(:),c(:),x(:),y(:)
read*,k,l,m
allocate(a(k))
allocate(b(l))
allocate(c(m))
allocate(x(m))
allocate(y(m))

do i=1,k
	read*,a(i)
end do

do i=1,l
	read*,b(i)
end do

do i=1,m 
	read*,x(i),y(i),c(i)
    s=a(x(i))+b(y(i))-c(i)
    ans=min(s,ans)
end do 

print*,ans
end program test