import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x, y, z,t; int p = 0; t = sc.nextInt(); while(t-->0){ x=sc.nextInt(); y=sc.nextInt(); z=sc.nextInt(); p=(x+y-z); System.out.println(p); } } }