
import java.util.Scanner;

/**
     *
     * @author abutair
     */
    public class Training {

        public static void main(String[] args) {
 

         Scanner sc = new Scanner(System.in);
         boolean bla= false;

                int r1 = sc.nextInt(),r2 = sc.nextInt(),c1= sc.nextInt(),c2= sc.nextInt(),d1 =sc.nextInt(),d2= sc.nextInt();
            int a,b,m,n;
                for(int i=1;i<=20;i++)
                {
                    a = i;
                    b = Math.abs(c1-a);
                    m = Math.abs(r1-a);
                    n = Math.abs(c2-m);
                    if(a+n == d1 && b+m == d2 && a!=m && b!=n && b!=0 && m!=0 && n!=0)
                    {
                        System.out.print(a);
                        System.out.println(" "+m);
                        System.out.print(b);
                        System.out.println(" "+n);
                         return;
                    }
                }


            System.out.println(-1);

        } // end Main


        
        
    
  
    } // end Class
