object Main extends App {                                                                                                                                       val sc = new java.util.Scanner (System.in)
  val a,b,m = sc.nextInt
  val alist = List.fill(a)(sc.nextInt)
  val blist = List.fill(b)(sc.nextInt)
  val mlist = List.fill(m)(List.fill(3)(sc.nextInt))
  var min = Int.MaxValue
  for(i <- 0 to m-1){
    if(alist(mlist(i)(0)) + blist(mlist(i)(1)) - mlist(i)(2) < min) min = alist(mlist(i)(0)) + blist(mlist(i)(1)) - mlist(i)(2)
  }
  println(min)
}