import java.util.Scanner;

public class HelpVasilisatheWise2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long r1 = sc.nextLong();
        long r2 = sc.nextLong();
        long c1 = sc.nextLong();
        long c2 = sc.nextLong();
        long d1 = sc.nextLong();
        long d2 = sc.nextLong();
        int a = (int) (d1 + (r1 - c2 - d1) / 2);
        int b = (int) (d2 - c1 + a);
        int c = (int) (d2 - c1 + a - c2 + r2);
        int d = (int) ((r1 - c2 - d1) / -2);
        if (a == b || a == c || a == d || b == c || b == d || c == d) {
            System.out.println(-1);
        }
        else if(a>9 || b>9 || c>9 || d>9){
            System.out.println(-1);
        }
        else if(a<1 || b<1 || c<1 || d<1){
            System.out.println(-1);
        }
        else {
            System.out.println(a + " " + b);
            System.out.println(c + " " + d);
        }
    }
}
