#!/bin/python3 import sys def profit(b, s, c): return b + s - c if __name__ == "__main__": t = int(input()) for _ in range(t): b, s, c = map(int, input().split()) result = profit(b, s, c) print(result)