
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;


/**
 *
 * @author mohanad elmaghrby
 */
public class Div2_143A {

    public static void main(String[] args) {
        Scanner scan = new Scanner (System.in);
        Set <Float> set = new HashSet<Float>();
        int arr[] = new int [6];
        float a,b,c,d;
        for (int i =0 ; i< 6 ;i ++)
            arr[i]= scan.nextInt();
        c = ( arr[2] -  arr[0]  +  arr[5] ) /2f ;
        b = arr[5] - c ;
        a =  arr[0] - b ;
        d = arr[1] - c ;
        
        set.add(a) ;
        set.add(b) ;
        set.add(c) ;
        set.add(d) ;
        if ((a*b*c*d)< (int)(a*b*c*d) || set.size()<4 || a<=0 ||a>9  || b<=0 || b>9 || c<=0 || c> 9 || d<=0 ||  d>9 && a+c== arr[2] && b+d == arr[3])
              System.out.println(-1);
        else
            System.out.println((int) a + " " +(int) b +" \n" +(int) c +" "+ (int) d + " ");
        
        
    }
    
}
