def main():

    #from sys import stdin, setrecursionlimit

    #setrecursionlimit(10**9)

    #r = input()

    #n = int(input())

    #a, b = map(int, input().split())

    #s, y = input().split()

    #a = input().split()

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

    #a = [input().split() for i in range(n)]

    #a = [int(input()) for i in range(n)]

    #a = [list(map(int, input().split())) for i in range(n)]

    #a = [int(s) - 1 for s in input().split()]

    #l=[int(input()) for _ in range(int(input()))]

    #res = 0



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

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

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



    res = [0] * (M+1)

    res[-1] = min(a)+min(b)

    for i in range(M):

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

        res[i] = a[x-1]+b[y-1]-c

    print((min(res)))





if __name__ == '__main__':

    main()



def main():

    _,_,m = list(map(int,input().split()))

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

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



    res = [0]*(m+1)

    res[-1] = min(a)+min(b)

    for i in range(m):

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

        res[i] = a[x-1]+b[y-1]-c

    print((min(res)))

if __name__ == '__main__':

    main()

def main():
    # from sys import stdin, setrecursionlimit
    # setrecursionlimit(10**9)
    # r = input()
    # n = int(input())
    # a, b = map(int, input().split())
    # s, y = input().split()
    # a = input().split()
    # a = list(map(int, input().split()))
    # a = [input().split() for i in range(n)]
    # a = [int(input()) for i in range(n)]
    # a = [list(map(int, input().split())) for i in range(n)]
    # a = [int(s) - 1 for s in input().split()]
    # l=[int(input()) for _ in range(int(input()))]
    # res = 0
    A, B, M = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    res = [0] * (M + 1)
    res[-1] = min(a) + min(b)
    for i in range(M):
        x, y, c = list(map(int, input().split()))
        res[i] = a[x - 1] + b[y - 1] - c
    print((min(res)))


if __name__ == "__main__":
    main()

def main():
    _, _, m = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    res = [0] * (m + 1)
    res[-1] = min(a) + min(b)
    for i in range(m):
        x, y, c = list(map(int, input().split()))
        res[i] = a[x - 1] + b[y - 1] - c
    print((min(res)))


if __name__ == "__main__":
    main()

-    # from sys import stdin, setrecursionlimit -    # setrecursionlimit(10**9) -    # r = input() -    # n = int(input()) -    # a, b = map(int, input().split()) -    # s, y = input().split() -    # a = input().split() -    # a = list(map(int, input().split())) -    # a = [input().split() for i in range(n)] -    # a = [int(input()) for i in range(n)] -    # a = [list(map(int, input().split())) for i in range(n)] -    # a = [int(s) - 1 for s in input().split()] -    # l=[int(input()) for _ in range(int(input()))] -    # res = 0 -    A, B, M = list(map(int, input().split())) +    _, _, m = list(map(int, input().split())) -    res = [0] * (M + 1) +    res = [0] * (m + 1) -    for i in range(M): +    for i in range(m):