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

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

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

xyc = [list(map(int, input().split())) for i in range(m)]

ans = min(al)+min(bl)

for l in xyc:

    p = al[l[0]-1] + bl[l[1]-1] -l[2]

    ans = min(ans,p)

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

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

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

ans = min(al)+min(bl)

for i in range(m):

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

    ans = min(ans, al[x-1]+bl[y-1]-c)

print(ans)
a, b, m = list(map(int, input().split()))
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for i in range(m)]
ans = min(al) + min(bl)
for l in xyc:
    p = al[l[0] - 1] + bl[l[1] - 1] - l[2]
    ans = min(ans, p)
print(ans)

a, b, m = list(map(int, input().split()))
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
ans = min(al) + min(bl)
for i in range(m):
    x, y, c = list(map(int, input().split()))
    ans = min(ans, al[x - 1] + bl[y - 1] - c)
print(ans)

-xyc = [list(map(int, input().split())) for i in range(m)] -for l in xyc: -    p = al[l[0] - 1] + bl[l[1] - 1] - l[2] -    ans = min(ans, p) +for i in range(m): +    x, y, c = list(map(int, input().split())) +    ans = min(ans, al[x - 1] + bl[y - 1] - c)