object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val ls = in.map(_.split(' ').map(_.toInt))
  val A = ls(1)
  //println(A.toSeq)
  val B = ls(2)
  //println(B.toSeq)
  val X = ls.tail.tail.tail
  
  val mina = A.min
  val minb = B.min
  var min = mina + minb
  X.foreach{ x =>
    val ai = x(0)
    val bi = x(1)
    val c = x(2)
    val local = A(ai-1) + B(bi-1) - c
    min = Math.min(min, local)
  }
  println(min)
}
