# Enter your code here. Read input from STDIN. Print output to STDOUT t = int(raw_input()) for tc in range(t): a, b, c = map(int, raw_input().split(" ")) print abs(c - (a + b))