def resolve():

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

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

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

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



    res = min(a) + min(b)



    for x, y, c in grid:

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



    print(res)

    

resolve()
import sys

 

A, B, M = list(map(int, sys.stdin.readline().split()))

*a, = list(map(int, sys.stdin.readline().split()))

*b, = list(map(int, sys.stdin.readline().split()))

xyc = list(zip(*[list(map(int, sys.stdin.read().split()))] * 3))

 

def main():

    res = min(a) + min(b)

 

    for x, y, c in xyc:

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

    return res

    

if __name__ == '__main__':

    ans = main()

    print(ans)
def resolve():
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    grid = [list(map(int, input().split())) for i in range(M)]
    res = min(a) + min(b)
    for x, y, c in grid:
        res = min(res, a[x - 1] + b[y - 1] - c)
    print(res)


resolve()

import sys

A, B, M = list(map(int, sys.stdin.readline().split()))
(*a,) = list(map(int, sys.stdin.readline().split()))
(*b,) = list(map(int, sys.stdin.readline().split()))
xyc = list(zip(*[list(map(int, sys.stdin.read().split()))] * 3))


def main():
    res = min(a) + min(b)
    for x, y, c in xyc:
        res = min(res, a[x - 1] + b[y - 1] - c)
    return res


if __name__ == "__main__":
    ans = main()
    print(ans)

-def resolve(): -    A, B, M = list(map(int, input().split())) -    a = list(map(int, input().split())) -    b = list(map(int, input().split())) -    grid = [list(map(int, input().split())) for i in range(M)] -    res = min(a) + min(b) -    for x, y, c in grid: -        res = min(res, a[x - 1] + b[y - 1] - c) -    print(res) +import sys + +A, B, M = list(map(int, sys.stdin.readline().split())) +(*a,) = list(map(int, sys.stdin.readline().split())) +(*b,) = list(map(int, sys.stdin.readline().split())) +xyc = list(zip(*[list(map(int, sys.stdin.read().split()))] * 3)) -resolve() +def main(): +    res = min(a) + min(b) +    for x, y, c in xyc: +        res = min(res, a[x - 1] + b[y - 1] - c) +    return res + + +if __name__ == "__main__": +    ans = main() +    print(ans)