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

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

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

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





yes_m = a[xyc[0][0]-1]+b[xyc[0][1]-1] - xyc[0][2]



for i in range(1,m):

    if yes_m > a[xyc[i][0]-1]+b[xyc[i][1]-1] - xyc[i][2]:

        yes_m = a[xyc[i][0]-1]+b[xyc[i][1]-1] - xyc[i][2]



no_m = min(a)+min(b)



print((min(no_m,yes_m)))

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 i in range(m):

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

    ans = min(ans, a[x-1]+b[y-1]-c)

print(ans)

a, b, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(m)]
yes_m = a[xyc[0][0] - 1] + b[xyc[0][1] - 1] - xyc[0][2]
for i in range(1, m):
    if yes_m > a[xyc[i][0] - 1] + b[xyc[i][1] - 1] - xyc[i][2]:
        yes_m = a[xyc[i][0] - 1] + b[xyc[i][1] - 1] - xyc[i][2]
no_m = min(a) + min(b)
print((min(no_m, yes_m)))

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 i in range(m):
    x, y, c = list(map(int, input().split()))
    ans = min(ans, a[x - 1] + b[y - 1] - c)
print(ans)

-xyc = [list(map(int, input().split())) for _ in range(m)] -yes_m = a[xyc[0][0] - 1] + b[xyc[0][1] - 1] - xyc[0][2] -for i in range(1, m): -    if yes_m > a[xyc[i][0] - 1] + b[xyc[i][1] - 1] - xyc[i][2]: -        yes_m = a[xyc[i][0] - 1] + b[xyc[i][1] - 1] - xyc[i][2] -no_m = min(a) + min(b) -print((min(no_m, yes_m))) +ans = min(a) + min(b) +for i in range(m): +    x, y, c = list(map(int, input().split())) +    ans = min(ans, a[x - 1] + b[y - 1] - c) +print(ans)