import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class test {

    public static void main(String[] args) {
        Scanner ob = new Scanner(System.in);
      	int r1=ob.nextInt();
      	int r2=ob.nextInt();
      	int c1=ob.nextInt();
      	int c2=ob.nextInt();
      	int d1=ob.nextInt();
      	int d2=ob.nextInt();
      	int y=(r1-c1+d2)/2;
      	int x=r1-y;
      	int u=d2-y;
      	int v=d1-x;
      	if(x<1 || y<1 || u<1 || v<1 || x==y || x==u || x==v || u==y || u==v || y==v)
      		System.out.println(-1);
      	else
      	{
      	System.out.println(x+" "+y);
      	System.out.println(u+" "+v);
    }
}
}
