let () =
  Scanf.scanf "%d %d %d\n" @@ fun a b m ->
  let arr = Array.init a @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d in
  let brr = Array.init b @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d in
  let crr = Array.init m @@ fun i -> Scanf.scanf "%d %d %d\n" @@
    fun x y c -> arr.(x-1) + brr.(y-1) - c in
  let ans1 =
    (Array.fold_left min arr.(0) arr) + (Array.fold_left min brr.(0) brr) in
  let ans2 = Array.fold_left min crr.(0) crr in
  Printf.printf "%d\n" (min ans1 ans2)