description: Polycarp had an array a of 3 positive integers. He wrote out the sums of all non-empty subsequences of this array, sorted them in non-decreasing order, and got an array b of 7 integers.
  
  For example, if a = \{1, 4, 3\}, then Polycarp wrote out 1, 4, 3, 1 + 4 = 5, 1 + 3 = 4, 4 + 3 = 7, 1 + 4 + 3 = 8. After sorting, he got an array b = \{1, 3, 4, 4, 5, 7, 8\}.
  
  Unfortunately, Polycarp lost the array a. He only has the array b left. Help him to restore the array a.
  
  Input
  
  The first line contains one integer t (1 ≤ t ≤ 5000) — the number of test cases.
  
  Each test case consists of one line which contains 7 integers b_1, b_2, ..., b_7 (1 ≤ b_i ≤ 10^9; b_i ≤ b_{i+1}). 
  
  Additional constraint on the input: there exists at least one array a which yields this array b as described in the statement.
  
  Output
  
  For each test case, print 3 integers — a_1, a_2 and a_3. If there can be several answers, print any of them.
  
  Example
  
  Input
  
  
  5
  1 3 4 4 5 7 8
  1 2 3 4 5 6 7
  300000000 300000000 300000000 600000000 600000000 600000000 900000000
  1 1 2 999999998 999999999 999999999 1000000000
  1 2 2 3 3 4 5
  
  
  Output
  
  
  1 4 3
  4 1 2
  300000000 300000000 300000000
  999999998 1 1
  1 2 2
  
  Note
  
  The subsequence of the array a is a sequence that can be obtained from a by removing zero or more of its elements.
  
  Two subsequences are considered different if index sets of elements included in them are different. That is, the values of the elements don't matter in the comparison of subsequences. In particular, any array of length 3 has exactly 7 different non-empty subsequences.
solution:     import java.math.*;
      import java.io.*;
      import java.util.*;
  
      
  //-------------------------------///////////////****/////////******//////////
  //------------------------------------///**********//*****//********//*****//
  //-----------------------------------///**********//*****//********//*****//
  //----------------------------------///**********//*****//********//*****//
  //---------------------------------///**********//*****//********//*****//
  //--------------------------------///**********//*****//********//*****//
  //--------------------------///**///**********//*****//********//*****//
  //---------------------------/////***********/////////*******//////////
  
      
      public class CodeForces
      {
      	final static String no = "NO";
      	final static String yes = "YES";
      	static long count = 0;
      	
      	static public OutputWriter w = new OutputWriter(System.out);
      	static public FastScanner sc = new FastScanner();
      	
  
      	static HashMap<Integer,Integer> map = new HashMap<>();
      	
      	static Scanner fc = new Scanner(System.in);
  
  //*******************************************Be SANSA**********************************************************
  //************************************Don't stick to single approach********************************************	
  //*****************************************You are a slow learner But you learn*********************************
  //***************************************Don't fall in rating trap***********************************************
  //**********************************Pain in temporary, regret remains forever************************************
      	
      	
          public static void main(String[] args) {
          	int test =sc.nextInt();
          	in:
          	while(test-->0) {
          		int[]arr = sc.readArray(7);
          		
          		for(int i=0;i<2;i++) {
          			w.writer.print(arr[i]+" ");
          		}
          		for(int i=2;i<7;i++) {
          			if(arr[0]+arr[1]+arr[i]==arr[6]) {
          				w.writer.print(arr[i]);
          				w.writer.println();
          				continue in;
          			}
          		}
          		//w.writer.println();
          	}
          	w.writer.flush();	
          }
          
          static int sod(long  n) {
          	int res = 0;
          	while(n!=0) {
          		res+=n%10;
          		n = n/10;
          	}
  			return res;
  		}
  		static class Pair {
              int visits, index;
              Pair(int visits, int index) {
                  this.visits = visits;
                  this.index = index;
              }
          }
          static public boolean checkBit(int n,int i){
              if((n>>i & 1)==1){
                  return true;
              }else{
                  return false;
              }
          }
          public static long pow(long a,long p)
          {
              long res=1;
              while(p>0)
              {
                  if(p%2==1)
                  {
                      p--;
                      res*=a;
                      res%=(long)1e9+7;
                  }
                  else
                  {
                      a*=a;
                      a%=(long)1e9+7;
                      p/=2;
                  }
              }
              return res;
          }
          static int gcd(int a, int b){
              if (a == 0)
                  return b;
              return gcd(b % a, a);
          }
          static long gcd(long a, long b){
              if (a == 0)
                  return b;
              return gcd(b % a, a);
          }
           
          // method to return LCM of two numbers
          static long lcm(long a, long b)
          {
              return (a / gcd(a, b)) * b;
          }
          static long getPairsCount(long[] arr, long sum)
          {
              Map<Long, Long> hm = new HashMap<>();
              int n = arr.length;
              long count = 0;
              for(int i =0;i<n;i++) {
              	if(hm.containsKey(sum - arr[i])) {
              		count+=hm.get(sum-arr[i]);
              	}
              	if(hm.get(arr[i])!=null) {
              		hm.put(arr[i], hm.get(arr[i])+1);
              	}
              	else {
              		hm.put(arr[i], 1l);
              	}
              }
              return count;
          }
          static long sumLong(int[]arr) {
          	long sum =0;
          	for(int x:arr) {
          		sum+=x;
          	}
          	return sum;
          }
          static boolean isEqualList(ArrayList<Integer> arr,ArrayList<Integer> temp){
              for(int i =0;i<arr.size();i++){
                  if(arr.get(i)!=temp.get(i)){
                      return true;
                  }
              }
              return false;
          }
      	static void sort(int[] arr) {
              Random rand = new Random();
              int n = arr.length;
              for (int i = 0; i < n; i++) {
                  int idx = rand.nextInt(n);
                  if (idx == i) continue;
                  arr[i] ^= arr[idx];
                  arr[idx] ^= arr[i];
                  arr[i] ^= arr[idx];
              }
              Arrays.sort(arr);
          }
       
          static void sort(long[] arr) {
              Random rand = new Random();
              int n = arr.length;
              for (int i = 0; i < n; i++) {
                  int idx = rand.nextInt(n);
                  if (idx == i) continue;
                  arr[i] ^= arr[idx];
                  arr[idx] ^= arr[i];
                  arr[i] ^= arr[idx];
              }
              Arrays.sort(arr);
          }
       
          static void sortDec(int[] arr) {
              Random rand = new Random();
              int n = arr.length;
              for (int i = 0; i < n; i++) {
                  int idx = rand.nextInt(n);
                  if (idx == i) continue;
                  arr[i] ^= arr[idx];
                  arr[idx] ^= arr[i];
                  arr[i] ^= arr[idx];
              }
              Arrays.sort(arr);
              int l = 0;
              int r = n - 1;
              while (l < r) {
                  arr[l] ^= arr[r];
                  arr[r] ^= arr[l];
                  arr[l] ^= arr[r];
                  l++;
                  r--;
              }
          }
       
          static void sortDec(long[] arr) {
              Random rand = new Random();
              int n = arr.length;
              for (int i = 0; i < n; i++) {
                  int idx = rand.nextInt(n);
                  if (idx == i) continue;
                  arr[i] ^= arr[idx];
                  arr[idx] ^= arr[i];
                  arr[i] ^= arr[idx];
              }
              Arrays.sort(arr);
              int l = 0;
              int r = n - 1;
              while (l < r) {
                  arr[l] ^= arr[r];
                  arr[r] ^= arr[l];
                  arr[l] ^= arr[r];
                  l++;
                  r--;
              }
          }
      	
      	
      	static int[] countInversions(int[]arr,int low,int high){
      		if(low==high) {
      			int base[] = new int[1];
      			base[0] = arr[low];
      			return base;
      		}
      		int mid = low+(high-low)/2;
      		int left[] = countInversions(arr,low,mid);
      		int right[] = countInversions(arr,mid+1,high);
      		int[]merged = merge(left,right);
      		return merged;
      	}
      	
      	
      	static int[] merge(int first[], int[]next) {
      		
      		int i = 0;
      		int j = 0;
      		int k = 0;
      		int[]merged = new int[first.length+next.length];
      		while(j<first.length && k<next.length) {
      			if(first[j]<=next[k]) {
      				merged[i++] = first[j++];
      			}else {
      				count += first.length -j;
      				merged[i++] = next[k++];
      				
      			}
      		}
      		while(j<first.length) {
      			merged[i++] = first[j++];
      		}
      		while(k<next.length) {
      			merged[i++] = next[k++];
      		}
      		return merged;
      	}
      	static class FastScanner {
      		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
      		StringTokenizer st=new StringTokenizer("");
      		String next() {
      			while (!st.hasMoreTokens())
      				try {
      					st=new StringTokenizer(br.readLine());
      				} catch (IOException e) {
      					e.printStackTrace();
      				}
      			return st.nextToken();
      		}
      		
      		int nextInt() {
      			return Integer.parseInt(next());
      		}
      		int [] readArray(int n) {
      			int[] a=new int[n];
      			for (int i=0; i<n; i++) a[i]=nextInt();
      			return a;
      		}
      		long nextLong() {
      			return Long.parseLong(next());
      		}
      		long [] longArray(int n) {
      			long[] a=new long[n];
      			for(int i=0 ; i<n ; i++) a[i]=nextLong();
      			return a;
      		}
      		double nextDouble() {
      			return Double.parseDouble(next());
      		}
      	}
          static public class OutputWriter {
              private  final PrintWriter writer;
       
              public OutputWriter(OutputStream outputStream) {
                  writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
              }
       
              public OutputWriter(Writer writer) {
                  this.writer = new PrintWriter(writer);
              }
       
              public void print(Object... objects) {
                  for (int i = 0; i < objects.length; i++) {
                      if (i != 0)
                          writer.print(' ');
                      writer.print(objects[i]);
                  }
              }
       
              public void printLine(Object... objects) {
                  print(objects);
                  writer.println();
              }
       
              public void close() {
                  writer.close();
              }
          }
       
       
      }