#!/usr/bin/env python3
N = int(input())
A = sum(map(int, input().split()))
print(A - int(input()))

6c85468643d8492d6fe34f9daf1a2e6ec6224fe1
<mask token>

<mask token>
print(A - int(input()))

N = int(input())
A = sum(map(int, input().split()))
print(A - int(input()))

#!/usr/bin/env python3
N = int(input())
A = sum(map(int, input().split()))
print(A - int(input()))
