program niceshopping
  implicit none
  integer(8) :: A, B, M, price, minprice, i, j
  integer(8),allocatable :: fri(:), ra(:), dsc(:,:)

  read(*,*) A, B, M
  allocate(fri(A), ra(B), dsc(3,M))

  read(*,*) fri
  read(*,*) ra
  do i = 1, M
     read(*,*) (dsc(j,i) ,j = 1, 3)
  end do

  minprice = fri(1) + ra(1)
  do i = 1, A
     do j = 1, B
        price = fri(i) + ra(j)
        if (price <= minprice) then
           minprice = price
        end if
     end do
  end do
  
  do i = 1, M
     price = fri(dsc(1,i)) + ra(dsc(2,i)) - dsc(3,i)
     if (price <= minprice) then
        minprice = price
     end if
  end do
  
  write(*,*) minprice

  stop
end program niceshopping
