fun main(args:Array<String>) {
    val (a,b,m) = readLine()!!.split(" ").map { it.toInt() }
    val aList = readLine()!!.split(" ").map { it.toInt() }
    val bList = readLine()!!.split(" ").map { it.toInt() }
    val waribiki = (1..m).map { readLine()!!.split(" ").map { it.toInt() } }
    var ans = aList.min()!! + bList.min()!!

    for(w in waribiki) {
        val tmp = aList[w[0]-1] + bList[w[1]-1] - w[2]
        ans = Math.min(ans, tmp)
    }
    println(ans)
}