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):

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

    s = a[c[0]-1]+b[c[1]-1]-c[2]

    ans = min(s,ans)



print(ans)
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,z = list(map(int,input().split()))

    s = a[x-1]+b[y-1]-z

    ans = (s if s < ans else ans)

 

print(ans)
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):
    c = list(map(int, input().split()))
    s = a[c[0] - 1] + b[c[1] - 1] - c[2]
    ans = min(s, ans)
print(ans)

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, z = list(map(int, input().split()))
    s = a[x - 1] + b[y - 1] - z
    ans = s if s < ans else ans
print(ans)

-    c = list(map(int, input().split())) -    s = a[c[0] - 1] + b[c[1] - 1] - c[2] -    ans = min(s, ans) +    x, y, z = list(map(int, input().split())) +    s = a[x - 1] + b[y - 1] - z +    ans = s if s < ans else ans