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

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

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



waribiki=[]



for _ in range(M):

    waribiki.append(list(map(int,input().split())))



MIN=min(a)+min(b)



for wari in waribiki:

    x=wari[0]-1

    y=wari[1]-1

    value=wari[2]

    total=a[x]+b[y]-value

    if(total < MIN):

        MIN=total



print(MIN)





def myAnswer(a:list,b:list,XYC:list) -> int:

   ans = min(a) + min(b)

   for x,y,c in XYC:

      total = a[x-1] + b[y-1] - c

      ans = min(total,ans)

   return ans







def modelAnswer():

   tmp=1

def main():

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

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

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

   XYC = []

   for _ in range(M):

      XYC.append(list(map(int,input().split())))

   print((myAnswer(a,b,XYC)))



if __name__ == '__main__':

   main()
A, B, M = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
waribiki = []
for _ in range(M):
    waribiki.append(list(map(int, input().split())))
MIN = min(a) + min(b)
for wari in waribiki:
    x = wari[0] - 1
    y = wari[1] - 1
    value = wari[2]
    total = a[x] + b[y] - value
    if total < MIN:
        MIN = total
print(MIN)

def myAnswer(a: list, b: list, XYC: list) -> int:
    ans = min(a) + min(b)
    for x, y, c in XYC:
        total = a[x - 1] + b[y - 1] - c
        ans = min(total, ans)
    return ans


def modelAnswer():
    tmp = 1


def main():
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    XYC = []
    for _ in range(M):
        XYC.append(list(map(int, input().split())))
    print((myAnswer(a, b, XYC)))


if __name__ == "__main__":
    main()

-A, B, M = list(map(int, input().split())) -a = list(map(int, input().split())) -b = list(map(int, input().split())) -waribiki = [] -for _ in range(M): -    waribiki.append(list(map(int, input().split()))) -MIN = min(a) + min(b) -for wari in waribiki: -    x = wari[0] - 1 -    y = wari[1] - 1 -    value = wari[2] -    total = a[x] + b[y] - value -    if total < MIN: -        MIN = total -print(MIN) +def myAnswer(a: list, b: list, XYC: list) -> int: +    ans = min(a) + min(b) +    for x, y, c in XYC: +        total = a[x - 1] + b[y - 1] - c +        ans = min(total, ans) +    return ans + + +def modelAnswer(): +    tmp = 1 + + +def main(): +    A, B, M = list(map(int, input().split())) +    a = list(map(int, input().split())) +    b = list(map(int, input().split())) +    XYC = [] +    for _ in range(M): +        XYC.append(list(map(int, input().split()))) +    print((myAnswer(a, b, XYC))) + + +if __name__ == "__main__": +    main()