a, b, m = list(map(int, input().split()))

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

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

AB = []

for _ in range(m):

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

    x -= 1

    y -= 1

    AB.append(A[x]+B[y]-c)

AB.sort()

A.sort()

B.sort()

print((min(AB[0], A[0]+B[0])))

a, b, m = list(map(int, input().split()))

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

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

ans = min(A)+min(B)

for _ in range(m):

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

    x -= 1

    y -= 1

    z = A[x]+B[y]-c

    if z < ans:

        ans = z

print(ans)

a, b, m = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
AB = []
for _ in range(m):
    x, y, c = list(map(int, input().split()))
    x -= 1
    y -= 1
    AB.append(A[x] + B[y] - c)
AB.sort()
A.sort()
B.sort()
print((min(AB[0], A[0] + B[0])))

a, b, m = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = min(A) + min(B)
for _ in range(m):
    x, y, c = list(map(int, input().split()))
    x -= 1
    y -= 1
    z = A[x] + B[y] - c
    if z < ans:
        ans = z
print(ans)

-AB = [] +ans = min(A) + min(B) -    AB.append(A[x] + B[y] - c) -AB.sort() -A.sort() -B.sort() -print((min(AB[0], A[0] + B[0]))) +    z = A[x] + B[y] - c +    if z < ans: +        ans = z +print(ans)