import java.util.ArrayList;





import java.util.Scanner;

public class Watermelon {
	public static void main(String[] args) {
             Scanner sc=new Scanner(System.in);
             int r1=sc.nextInt();
             int r2=sc.nextInt();
             int c1=sc.nextInt();
             int c2=sc.nextInt();
             int d1=sc.nextInt();
             int d2=sc.nextInt();
             int x2=(r2-d1+c1)/2;
             int x1=c1-x2;
             int y2=(c2+r2-d2)/2;
             int y1=c2-y2;
             if(x1==x2||x1==y1||x1==y2||x2==y1||x2==y2||y2==y1||x1>9||y2>9||y1>9||x2>9||x1==0||y2==0||y1==0||x2==0){
            	 System.out.println(-1);
            	 System.exit(0);
             }
             System.out.println(x1+" "+y1);
             System.out.println(x2+" "+y2);
             
	}
	

	 static void display(char[][] arr){
			for(int i=0;i<arr.length;i++){
				for(int j=0;j<arr[i].length;j++){
				//	System.out.println(i);
				System.out.print(arr[i][j]+"");
				}
				System.out.println();
			}	
			System.out.println();
		  }
	 static void display(char[] arr){
			for(int i=0;i<arr.length;i++){
				System.out.print(arr[i]+" ");
			}	
			System.out.println();
		
		  }
	 static void display(int[] arr){
			for(int i=0;i<arr.length;i++){
				System.out.println(arr[i]);
			}	
		
		  }
	 static void display(double[] arr){
		// System.out.println();
			for(int i=0;i<arr.length;i++){
				System.out.print(arr[i]+" ");
			}	
			System.out.println();
		
		  }
	 static String str(char[] carr){
		 String str="";
		 for(int i=0;i<carr.length;i++){
			    str=str+carr[i];
			}
		 return str;
	 }
	 
	}


