import java.util.*;
public class HelpVasilisatheWise2 {

	public static void main(String[] args) {
		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();
		int dl =d2+c1-r1;
		LinkedHashSet<Integer> result=new LinkedHashSet<>();
		int l=dl/2;
		int m=c1-l;
		int n=r1-m;
		int o1=c2-n;
		int o2=d1-m;
		result.add(m);
		result.add(n);
		result.add(l);
		result.add(o1);
		if(dl<=0||dl%2==1||m<=0||n<=0||o1!=o2||o1<=0||result.size()<4) {
			System.out.println(-1);
			System.exit(0);
		}
		System.out.printf("%d %d\n%d %d",m,n,l,o1);
	}

}
