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

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

B = sum(A)

if B > N:

    ans = -1

else:

    ans = N - B

print(ans)

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

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

sum = sum(A)

if sum > N:

    ans = -1

else:

    ans = N - sum

print(ans)

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

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

-B = sum(A) -if B > N: +sum = sum(A) +if sum > N: -    ans = N - B +    ans = N - sum