for _ in range(int(input())):
    a,b,c=map(int,input().split())
    print(abs(c-a-b))