f=lambda:list(map(int,input().split()))

_,_,n=f()

a,b=list(f()),list(f())

m=min(a)+min(b)

for _ in range(n): x,y,c=f(); m=min(m,a[x-1]+b[y-1]-c)

print(m)
import sys

f=lambda:list(map(int,sys.stdin.readline().split()))

_,_,n=f()

a,b=list(f()),list(f())

m=min(a)+min(b)

for _ in range(n): x,y,c=f(); m=min(m,a[x-1]+b[y-1]-c)

print(m)
f = lambda: list(map(int, input().split()))
_, _, n = f()
a, b = list(f()), list(f())
m = min(a) + min(b)
for _ in range(n):
    x, y, c = f()
    m = min(m, a[x - 1] + b[y - 1] - c)
print(m)

import sys

f = lambda: list(map(int, sys.stdin.readline().split()))
_, _, n = f()
a, b = list(f()), list(f())
m = min(a) + min(b)
for _ in range(n):
    x, y, c = f()
    m = min(m, a[x - 1] + b[y - 1] - c)
print(m)

-f = lambda: list(map(int, input().split())) +import sys + +f = lambda: list(map(int, sys.stdin.readline().split()))