import java.util.Scanner;
public class JavaApplication2 {
    public static void main(String[] args) {        
        Scanner  reader = new Scanner(System.in); 
     
        int r1=reader.nextInt();
        int r2=reader.nextInt();
        int c1=reader.nextInt();
        int c2=reader.nextInt();
        int d1=reader.nextInt();
        int d2=reader.nextInt();
        int[][]arr=new int[2][2];
        boolean bool=false;
        for(int i=0;i<=c1;i++){
            if(bool)break;
            arr[0][0]=i;
            arr[1][0]=c1-i;
            for(int j=0;j<=c2;j++){
                arr[0][1]=j;
                arr[1][1]=c2-j;
                if(i+j==r1&&c1-i+c2-j==r2&&i+c2-j==d1&&c1-i+j==d2)
                {bool=true; break;}
            }
        }        
        boolean identical=!((arr[0][0]==arr[0][1])||(arr[0][0]==arr[1][0])||(arr[0][0]==arr[1][1])||(arr[0][1]==arr[1][0])||(arr[0][1]==arr[1][1])||(arr[1][0]==arr[1][1]));
        boolean num=!((arr[0][0]>=10)||(arr[0][1]>=10)||(arr[1][0]>=10)||(arr[1][1]>=10));
        if(bool&&identical&&num){
        System.out.println(arr[0][0]+" "+arr[0][1]); 
        System.out.println(arr[1][0]+" "+arr[1][1]); 
        }else 
            System.out.println("-1"); 
}}