import java.lang.reflect.Array;
import java.util.*;

public class Main {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int r1=sc.nextInt(),r2=sc.nextInt(),c1=sc.nextInt(),c2=sc.nextInt(),d1=sc.nextInt(),d2=sc.nextInt();
        int x=(r1+c1-d1)/2;
        System.out.println(x+ " "+ (r1-x) );
        System.out.print((c1-x)+" "+(d1-x));


    }

}