""" Python 3.6 Author: Deepankar Sharma """ for t in range(int(input())): b, s, c = map(int, input().split()) print(b + s - c)