T = int(input()) for t in range(T): v = list(int(x) for x in input().split()) print(v[0] + v[1] - v[2])