t = int(raw_input()) for _ in range(t): l = map(int,raw_input().split()) print l[0]+l[1]-l[2]