import java.util.*;
import java.lang.*;

public class A {
    public static void main(String[] args) {
        // getting the inputs
        Scanner in = new Scanner(System.in);
        int r1 = in.nextInt();
        int r2 = in.nextInt();
        int c1 = in.nextInt();
        int c2 = in.nextInt();
        int d1 = in.nextInt();
        int d2 = in.nextInt();
        // printing the output
        new Solver().solve(r1,r2,c1,c2,d1,d2);
    }
}

class Solver {
    public void solve(int r1, int r2, int c1, int c2, int d1, int d2) {  
        int[] ans = new int[4];
        ans[0] = Math.min(r1, Math.min(c1, d1)) - 1;
        ans[1] = r1 - ans[0];
        ans[2] = c1 - ans[0];
        ans[3] = d1 - ans[0];
        while(ans[0] > 0) {
            HashSet<Integer> arr = new HashSet();
            arr.add(ans[0]);
            arr.add(ans[1]);
            arr.add(ans[2]);
            arr.add(ans[3]);
            if((arr.size() == 4) && (r1 == ans[0] + ans[1]) && (r2 == ans[2] + ans[3]) && (c1 == ans[0] + ans[2]) && (c2 == ans[1] + ans[3]) && (d1 == ans[0] + ans[3]) && (d2 == ans[2] + ans[1])) {
                System.out.println(ans[0] + " " + ans[1]);
                System.out.println(ans[2] + " " + ans[3]);
                return;
            }
            ans[0]--;
            ans[1]++;
            ans[2]++;
            ans[3]++;
        }
        System.out.println("-1");
    }
}
