fun main(args : Array<String>) {
    val (a, b, m) = readLine()!!.split(" ").map { it.toInt() }
    val aa = readLine()!!.split(" ").map { it.toLong() }
    val bb = readLine()!!.split(" ").map { it.toLong() }

    var min = aa.min()!! + bb.min()!!

    repeat(m) {
        val (ai, bi, c) = readLine()!!.split(" ").map { it.toInt() }
        val sum = aa[ai-1] + bb[bi-1] - c
        min = Math.min(min, sum)
    }

    println(min)
}