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

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

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

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



ans = [min(a) + min(b)]

for x in X:

    a_idx, b_index, c = x

    ans.append(a[a_idx - 1] + b[b_index - 1] - c)



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

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

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

cost = min(a_li) + min(b_li)

for i in range(m):

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

  price = a_li[x-1] + b_li[y-1] - c

  if price < cost:

    cost = price

print(cost)

A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
X = [list(map(int, input().split())) for i in range(M)]
ans = [min(a) + min(b)]
for x in X:
    a_idx, b_index, c = x
    ans.append(a[a_idx - 1] + b[b_index - 1] - c)
print((min(ans)))

a, b, m = list(map(int, input().split()))
a_li = list(map(int, input().split()))
b_li = list(map(int, input().split()))
cost = min(a_li) + min(b_li)
for i in range(m):
    x, y, c = list(map(int, input().split()))
    price = a_li[x - 1] + b_li[y - 1] - c
    if price < cost:
        cost = price
print(cost)

-A, B, M = list(map(int, input().split())) -a = list(map(int, input().split())) -b = list(map(int, input().split())) -X = [list(map(int, input().split())) for i in range(M)] -ans = [min(a) + min(b)] -for x in X: -    a_idx, b_index, c = x -    ans.append(a[a_idx - 1] + b[b_index - 1] - c) -print((min(ans))) +a, b, m = list(map(int, input().split())) +a_li = list(map(int, input().split())) +b_li = list(map(int, input().split())) +cost = min(a_li) + min(b_li) +for i in range(m): +    x, y, c = list(map(int, input().split())) +    price = a_li[x - 1] + b_li[y - 1] - c +    if price < cost: +        cost = price +print(cost)