import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;
import java.util.ArrayList;
import java.util.Collections;
import java.lang.Math; 

public class Lo {
    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 = (r1+d1-c2)/2;
      int b = (r1+d2-c1)/2;
      int c = (r2+d2-c2)/2;
      int d = (r2+d1-c1)/2;
      if(a==b || c==d || a>9 || b>9 || c>9 || d>9){
          System.out.println(-1);
      }
      else{
          System.out.println(a+" "+b);
          System.out.println(c+" "+d);
      }
    }
}