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

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



ans = n-  sum(a)



if ans>=0:

    print(ans)

else:

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

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



print((max(-1,N-sum(A))))
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
ans = n - sum(a)
if ans >= 0:
    print(ans)
else:
    print((-1))

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

-n, m = list(map(int, input().split())) -a = list(map(int, input().split())) -ans = n - sum(a) -if ans >= 0: -    print(ans) -else: -    print((-1)) +N, M = list(map(int, input().split())) +A = list(map(int, input().split())) +print((max(-1, N - sum(A))))