N,M = list(map(int,input().split()))

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



A_sum = sum(A)

ans = N - A_sum



if ans>=0:

    print(ans)

else:

    print((-1))
N,M = list(map(int,input().split()))

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



A_sum = sum(A)



if N - A_sum>=0:

    print((N - A_sum))

else:

    print((-1))

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A_sum = sum(A)
ans = N - A_sum
if ans >= 0:
    print(ans)
else:
    print((-1))

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
A_sum = sum(A)
if N - A_sum >= 0:
    print((N - A_sum))
else:
    print((-1))

-ans = N - A_sum -if ans >= 0: -    print(ans) +if N - A_sum >= 0: +    print((N - A_sum))