
import java.util.Scanner;


public class Main {
    public static boolean result(int r1,int r2, int c1,int c2,int d1,int d2,int[][] square )
    {
        if(square[0][0]==square[0][1] && square[1][0]==square[1][1] && square[0][1]==square[0][0] && square[0][1]==square[1][1]&& square[1][1]==square[0][0] && square[0][1]==square[1][0] ) return false;
        if(r1==square[0][0]+square[0][1] && r2==square[1][0]+square[1][1] && c1==square[0][0]+square[1][0] && c2==square[0][1]+square[1][1] && d1==square[0][0]+square[1][1] && d2==square[1][0]+square[0][1])
        {
            return true;
        }
        return false;
    }
    public static void main(String[] args) throws InterruptedException {
        Scanner lectura = new Scanner(System.in);
        int r1,r2,c1,c2,d1,d2;
        while(lectura.hasNext())
        {
            r1 = lectura.nextInt();
            r2 = lectura.nextInt();
            c1 = lectura.nextInt();
            c2 = lectura.nextInt();
            d1 = lectura.nextInt();
            d2 = lectura.nextInt();
            int[][] square = new int[2][2];
            thip:
            for(int i=0;i<10000;i++)
            {
                 double number = i;
                 number =number/1000;

                 square[0][0]=(int)Math.ceil(number);
                 number = number-(int)number;
                 number =number*10;
       
                 square[0][1]=(int)Math.ceil(number);
                 number = number- (int)number;
                 number =number*10;

                 square[1][0]=(int)Math.ceil(number);
                 number = number- (int)number;
                 number =number*10;

                 square[1][1]=(int)Math.ceil(number);
                 number = number- (int)number;
            if(result(r1, r2, c1, c2, d1, d2, square))
            {
                for(int K=0;K<2;K++)
                {
                    System.out.println(square[K][0]+" "+square[K][1]);
                }
                break thip;
            }else
            {
                if(i==9999)
                    System.out.println("-1");
            }
            
            }
        }
    }
    
}
