
object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  val A, B, M = sc.nextInt()
  val a = Array.fill(A)(sc.nextInt())
  val b = Array.fill(B)(sc.nextInt())
  val m = Array.fill(M)(sc.nextInt(), sc.nextInt(), sc.nextInt())
    .map{ case (x, y, z) => a(x-1) + b(y-1) - z}.min
  var ans = (a.min + b.min).min(m)
  println(ans)
}
