A,B,M = list(map(int,input().split()))

Ai = list(map(int,input().split()))

Bi = list(map(int,input().split()))

amin = min(Ai)

bmin= min(Bi)

min = amin+bmin

for i in range(M):

	xi,yi,ci = list(map(int,input().split()))

	if Ai[xi-1] + Bi[yi-1] - ci < min:

		min = Ai[xi-1] + Bi[yi-1] - ci

print(min)

# hitachi2020_b.py

_, _, M = list(map(int, input().split()))

A = list(map(int, input().split()))

B = list(map(int, input().split()))

X = []

Y = []

C = []

amin = min(A)

bmin = min(B)

for i in range(M):

    x, y, c = list(map(int, input().split()))

    X.append(x)

    Y.append(y)

    C.append(c)



ans = amin+bmin

for i in range(M):

    if ans >= A[X[i]-1]+B[Y[i]-1]-C[i]:

        ans = A[X[i]-1]+B[Y[i]-1]-C[i]

print(ans)

A, B, M = list(map(int, input().split()))
Ai = list(map(int, input().split()))
Bi = list(map(int, input().split()))
amin = min(Ai)
bmin = min(Bi)
min = amin + bmin
for i in range(M):
    xi, yi, ci = list(map(int, input().split()))
    if Ai[xi - 1] + Bi[yi - 1] - ci < min:
        min = Ai[xi - 1] + Bi[yi - 1] - ci
print(min)

# hitachi2020_b.py
_, _, M = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
X = []
Y = []
C = []
amin = min(A)
bmin = min(B)
for i in range(M):
    x, y, c = list(map(int, input().split()))
    X.append(x)
    Y.append(y)
    C.append(c)
ans = amin + bmin
for i in range(M):
    if ans >= A[X[i] - 1] + B[Y[i] - 1] - C[i]:
        ans = A[X[i] - 1] + B[Y[i] - 1] - C[i]
print(ans)

-A, B, M = list(map(int, input().split())) -Ai = list(map(int, input().split())) -Bi = list(map(int, input().split())) -amin = min(Ai) -bmin = min(Bi) -min = amin + bmin +# hitachi2020_b.py +_, _, M = list(map(int, input().split())) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +X = [] +Y = [] +C = [] +amin = min(A) +bmin = min(B) -    xi, yi, ci = list(map(int, input().split())) -    if Ai[xi - 1] + Bi[yi - 1] - ci < min: -        min = Ai[xi - 1] + Bi[yi - 1] - ci -print(min) +    x, y, c = list(map(int, input().split())) +    X.append(x) +    Y.append(y) +    C.append(c) +ans = amin + bmin +for i in range(M): +    if ans >= A[X[i] - 1] + B[Y[i] - 1] - C[i]: +        ans = A[X[i] - 1] + B[Y[i] - 1] - C[i] +print(ans)