import java.io.*;
import java.util.*;

public class HelpVasilisaTheWise2 {
    public static void main(String[] args) throws IOException {
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(f.readLine());
        int r1 = Integer.parseInt(st.nextToken());
        int r2 = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(f.readLine());
        int c1 = Integer.parseInt(st.nextToken());
        int c2 = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(f.readLine());
        int d1 = Integer.parseInt(st.nextToken());
        int d2 = Integer.parseInt(st.nextToken());
        
        int w = (c1+d1-r2)/2;
        int x = r1-w;
        int y = c1-w;
        int z = r2-c1+w;
        if (r1+r2 == c1+c2 && w+z == d1 && x+y == d2 && w != x && w != y && w != z && x != y && x != z && y != z)
        {
            System.out.println(w+" "+x);
            System.out.println(y+" "+z);
        }
        else
            System.out.println(-1);
    }   
}