import java.io.IOException;
import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 * User: Пользователь
 * Date: 12.01.12
 * Time: 19:19
 * To change this template use File | Settings | File Templates.
 */
public class A {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int r1,r2,c1,c2,d1,d2,k=0;
        r1=sc.nextInt();
        r2=sc.nextInt();
        c1=sc.nextInt();
        c2=sc.nextInt();
        d1=sc.nextInt();
        d2=sc.nextInt();
        if (r1+r2!=c1+c2){
            System.out.println(-1);}
        else
        {
            for(int i=1;i<=10;i++){
                int x=i;
                int y=c1-x;
                int x1=r1-x;
                int y1=r2-y;
                        if((x+y1==d1)&(y1+x1==c2)&(y+x1==d2)&((x!=x1)&(x!=y)&(x!=y1)&(x1!=y1)&(x1!=y)&(y!=y1))&(x>0)&(y>0)&(y1>0)&(x1>0)){
                            System.out.println(x+" "+x1+" "+y+" "+y1);return;}
                    else k++;
            }
        }
        if (k==10) System.out.println(-1);


    }

}
