program nice_shopping
  implicit none
  integer :: na, nb, m, x, y, c, i, ans
  integer, dimension(100000) :: a = 0, b = 0
  read(*,*) na, nb, m
  read(*,*) a(1:na)
  read(*,*) b(1:nb)
  ans = minval(a(1:na))+minval(b(1:nb))
  do i = 1, m
    read(*,*) x, y, c
    ans = min(ans,a(x)+b(y)-c)
  end do
  write(*,'(i0)') ans
end program nice_shopping