import Control.Applicative
import Control.Monad
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.Char (isSpace)
import Data.Vector (Vector, (!))
import qualified Data.Vector as V

main :: IO ()
main = do
  [_, _, m] <- g
  solve <$> f <*> f <*> replicateM m g >>= print
  where
    f = readiv B.readInt <$> B.getLine
    g = map read <$> words <$> getLine

solve :: Vector Int -> Vector Int -> [[Int]] -> Int
solve va vb xss = foldl f (V.minimum va + V.minimum vb) xss
  where
    f mn [x, y, c] = min mn $ va ! (x - 1) + vb ! (y - 1) - c

readiv :: Integral a => (ByteString -> Maybe (a, ByteString)) -> ByteString -> Vector a
readiv f = V.unfoldr $ \s -> do
  (n, s') <- f s
  return (n, B.dropWhile isSpace s')
