import sys

input = sys.stdin.readline



def main():

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

    t_a = tuple(map(int, input().split()))

    t_b = tuple(map(int, input().split()))

    t_ken = [tuple(map(int, input().split())) for _ in range(m)]



    r = min(t_a) + min(t_b)

    for x, y, c in t_ken:

        r = min(r, t_a[x-1] + t_b[y-1] - c)

    print(r)



if __name__ == '__main__':

    main()

import sys

read = sys.stdin.read

def main():

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

    al = tuple(map(int, input().split()))

    bl = tuple(map(int, input().split()))

    r = min(al) + min(bl)

    m = list(map(int, read().split()))

    xyc = list(zip(m, m, m))

    for x, y, c in xyc:

        r = min(r, al[x-1] + bl[y-1] - c)

    print(r)



if __name__ == '__main__':

    main()
import sys

input = sys.stdin.readline


def main():
    a, b, m = list(map(int, input().split()))
    t_a = tuple(map(int, input().split()))
    t_b = tuple(map(int, input().split()))
    t_ken = [tuple(map(int, input().split())) for _ in range(m)]
    r = min(t_a) + min(t_b)
    for x, y, c in t_ken:
        r = min(r, t_a[x - 1] + t_b[y - 1] - c)
    print(r)


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read


def main():
    a, b, m = list(map(int, input().split()))
    al = tuple(map(int, input().split()))
    bl = tuple(map(int, input().split()))
    r = min(al) + min(bl)
    m = list(map(int, read().split()))
    xyc = list(zip(m, m, m))
    for x, y, c in xyc:
        r = min(r, al[x - 1] + bl[y - 1] - c)
    print(r)


if __name__ == "__main__":
    main()

-input = sys.stdin.readline +read = sys.stdin.read -    t_a = tuple(map(int, input().split())) -    t_b = tuple(map(int, input().split())) -    t_ken = [tuple(map(int, input().split())) for _ in range(m)] -    r = min(t_a) + min(t_b) -    for x, y, c in t_ken: -        r = min(r, t_a[x - 1] + t_b[y - 1] - c) +    al = tuple(map(int, input().split())) +    bl = tuple(map(int, input().split())) +    r = min(al) + min(bl) +    m = list(map(int, read().split())) +    xyc = list(zip(m, m, m)) +    for x, y, c in xyc: +        r = min(r, al[x - 1] + bl[y - 1] - c)