import java.util.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in=new Scanner(System.in);
        int r1=in.nextInt(),
            r2=in.nextInt(),
            c1=in.nextInt(),
            c2=in.nextInt(),
            d1=in.nextInt(),
            d2=in.nextInt();
        int a=0,b=0,c=0,d=0,flag=0;
        int i=1;
        while(c+d!=r2 || a+d!=d1 || b+c!=d2){
            a=i;
            b=r1-i;
            c=c1-a;
            d=c2-b;
            i++;
            if(i==8){
                flag=1;
                break;
            }
        }
        if(a==b || b==c || c==d)
            flag=1;
        if(flag==1)
            System.out.println(-1);
        else
            System.out.println(a+" "+b+"\n"+c+" "+d);
	}
}