from collections import defaultdict as dd t = int(input()) while t > 0: b, s, c = map(int, input().split()) print(abs(c - b - s)) t -= 1