import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Dpcoins {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastScanner scan = new FastScanner(System.in) ;
		// get input
		int r1=scan.nextInt(),r2=scan.nextInt() ;
		int c1=scan.nextInt(),c2=scan.nextInt() ;
		int d1=scan.nextInt(),d2=scan.nextInt() ;
		print(get_gems(r1, r2, c1, c2, d1, d2));
	}
	
	public static int [][] get_gems(int r1, int r2, int c1, int c2, int d1, int d2) {
		int [][] a = new int [2][2] ;
		Set <Integer> set = new HashSet<Integer>();
		for (int i = 0; i < Math.min(d1, d2)+1; i++) {
			set.removeAll(set) ;
			a[0][0] = i ;
			set.add(a[0][0]) ;
			a[1][1] = d1-i ;
			set.add(a[1][1]) ;
			a[0][1] = c2 -a[1][1] ;
			set.add(a[0][1]) ;
			a[1][0] = d2 - a[0][1] ;
			set.add(a[1][0]) ;
			if (a[0][0]>9||a[0][1]>9||a[1][0]>9||a[1][1]>9) {
				continue ;
			}
			if (set.size()<4) {
				continue ;
			}
			else if ((a[0][0]+a[1][0]==c1) && (a[0][0]+a[0][1]==r1) && (a[0][1]+a[1][1]==c2) && (a[1][0]+a[1][1]==r2) ) {
				return a ;
			}
			else {
				continue ;
			}
		}
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				a[i][j] = -1 ;
			}
		}
		return a ;
	}
	
	public static void print (int [][] a) {
		boolean flag = true ;
		for (int i = 0; i < 2; i++) {
			for (int j = 0; j < 2; j++) {
				if (a[i][j]==-1) {
					System.out.println(-1);
					System.exit(0);
				}
				else {
					System.out.print(a[i][j]+" ");
				}
			}
			System.out.println();
		}
	}
	
	
	
	

}

class FastScanner {
    BufferedReader br;
    StringTokenizer st;

    FastScanner(InputStream stream) {
        try {
            br = new BufferedReader(new InputStreamReader(stream));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    String next() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }
}



