fun intList() = readLine()?.split(" ")?.map(String::toInt) ?: TODO()
fun main(args: Array<String>) {
    val (a, b, m) = intList()
    val aa = intList()
    val bb = intList()
    val notDiscount = aa.min()!! + bb.min()!!
    val discount = 0.until(m).map {
        val (x, y, c) = intList()
        aa[x - 1] + bb[y - 1] - c
    }.min()!!
    val min = Math.min(notDiscount, discount)
    println(min.toString())
}