module Hitachi2020.B

let fLine = stdin.ReadLine().Split(' ') |> Array.map int
let aNum = fLine.[0]
let bNum = fLine.[1]
let mNum = fLine.[2]

let aArray = stdin.ReadLine().Split(' ') |> Array.map int
let bArray = stdin.ReadLine().Split(' ') |> Array.map int

let mArray num =
    seq {
        for _ in 1 .. num -> stdin.ReadLine().Split(' ') |> Array.map int
    }
    |> Seq.toList

let minPriceWithTicket =
    mArray mNum
    |> List.map (fun m -> aArray.[m.[0] - 1] + bArray.[m.[1] - 1] - m.[2])
    |> List.min

let minPriceNoTicket = (Array.min aArray) + (Array.min bArray)

min minPriceNoTicket minPriceWithTicket |> printf "%d"
