program H2020B
    implicit none
    integer(8)::A,B,M,i,ans
    integer(8),allocatable,dimension(:)::Ai,Bi,X,Y,C
    ans=1000000
    read(5,*)A,B,M
    allocate(Ai(A))
    allocate(Bi(B))
    allocate(X(M))
    allocate(Y(M))
    allocate(C(M))
    read(5,*)(Ai(i),i=1,A)
    read(5,*)(Bi(i),i=1,B)
    read(5,*)(X(i),Y(i),C(i),i=1,M)

    !割引券適用
    do i=1,M
        ans=min(ans,Ai(X(i))+Bi(Y(i))-C(i))
    end do
    
    ans=min(ans,minval(Ai)+minval(Bi))
    print'(i0)',ans
end program H2020B