import java.util.*;
public class Main{
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int r1=sc.nextInt();
      int r2=sc.nextInt();
      int c1=sc.nextInt();
      int c2=sc.nextInt();
      int d1=sc.nextInt();
      int d2=sc.nextInt();
      int a,b,c,d;
      b=(c2+d2-r2)/2;
      if(b>0){
          a=r1-b;
          c=c1-a;
          d=c2-b;
          if(a>0&&c>0&&d>0){System.out.print(a+" "+b);System.out.println();System.out.print(c+" "+d);}
          else{System.out.println("-1");}
      }
      else{System.out.println("-1");}
    }
}