import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); while(t-- > 0) { int b = scan.nextInt(), s = scan.nextInt(), c = scan.nextInt(); System.out.println((b+s)-c); } scan.close(); } }