import java.util.* ;
import java.lang.* ;
import java.io.*;

public class javaTemplate {
	
	static FastReader sc = new FastReader();
	//	static Scanner sc = new Scanner(System.in) ;

	public static void main(String[] args) {
		
		int r1 = sc.nextInt() ;
		int r2 = sc.nextInt() ;
		
		int c1 = sc.nextInt() ;
		int c2 = sc.nextInt() ;
		
		int d1 = sc.nextInt() ;
		int d2 = sc.nextInt() ;
		boolean val = false ;
		if(r1 > 17 || r2 > 17 || c1 > 17 || c2 > 17 || d1 > 17 || d2 > 17) val = true ;
		Set<Integer> set = new HashSet<>() ;
		Set<Integer> set2 = new HashSet<>() ;
		int a = (r2+c1-d1)/2 ;
		int b = (r1+c2-d1)/2 ;
		int x = c1-a ;
		int y = c2-b ;
		set.add(a) ;
		set.add(b) ;
		set.add(x) ;
		set.add(y) ;
		set2.add(r1) ;
		set2.add(r2) ;
		set2.add(c1) ;
		set2.add(c2) ;
		set2.add(d1) ;
		set2.add(d2) ;
		
		if(val || (a == 0 || b == 0 || x == 0 || y == 0)||(set.size() != 4) || (set2.size() != 6)) {
			System.out.println("-1");
		} else {
		System.out.println(x + " " + b);
		System.out.println(a + " " + y);
		}
		
	}
	
								//Template//
	
	
		//		FAST I/O
		static class FastReader {
	        BufferedReader br;
	        StringTokenizer st;
	        
	        public FastReader()
	        {
	            br = new BufferedReader(
	                new InputStreamReader(System.in));
	        }
	 
	        String next()
	        {
	            while (st == null || !st.hasMoreElements()) {
	                try {
	                    st = new StringTokenizer(br.readLine());
	                }
	                catch (IOException e) {
	                    e.printStackTrace();
	                }
	            }
	            return st.nextToken();
	        }
	 
	        int nextInt() { return Integer.parseInt(next()); }
	 
	        long nextLong() { return Long.parseLong(next()); }
	 
	        double nextDouble()
	        {
	            return Double.parseDouble(next());
	        }
	 
	        String nextLine()
	        {
	            String str = "";
	            try {
	                str = br.readLine();
	            }
	            catch (IOException e) {
	                e.printStackTrace();
	            }
	            return str;
	        }
		}
	
	
		
}
	