n = int(input()) for i in range(n): A = list(map(int, input().strip().split())) print(sum(A[1:]))