#!/bin/python

import sys

def profit(b, s, c):
    # Return the fixed profit.
    return b + s - c

if __name__ == "__main__":
    t = int(raw_input().strip())
    for a0 in xrange(t):
        b, s, c = raw_input().strip().split(' ')
        b, s, c = [int(b), int(s), int(c)]
        result = profit(b, s, c)
        print result