program main

  implicit none
  integer :: a, b, m
  integer,allocatable :: aa(:), bb(:), x(:), y(:), c(:)
  
  integer :: i, tmp
  integer,allocatable :: ans(:)
  
  read(*,*) a, b, m
  allocate( aa(a) )
  allocate( bb(b) )
  read(*,*) aa
  read(*,*) bb
  allocate( x(m) )
  allocate( y(m) )
  allocate( c(m) )
  do i = 1, m
    read(*,*) x(i), y(i), c(i)
  end do

  allocate( ans(m) )

  do i = 1, m
    ans(i) = aa(x(i)) + bb(y(i)) -c(i)
  end do
  
  tmp =  minval( aa ) + minval( bb )
  
  if( minval( ans ) > tmp ) then
    print*, tmp
  else
    print*, minval( ans )
  endif
  
  

end program main
