import java.io.*;
import java.util.*;
/**
 *
 * @author cybros.ru
 */
public class Main {
     PrintWriter cout;
    Scanner cin;
    public static void main(String[] args) throws IOException {
        new Main().run();
    }
    
    void run() throws IOException{
     cout =new PrintWriter(new OutputStreamWriter(System.out));  
     cin = new Scanner(System.in);   
     solve();
     cout.flush();
    }
    
    void solve() throws IOException{
        int r1=cin.nextInt();
        int r2=cin.nextInt();
        int c1=cin.nextInt();
        int c2=cin.nextInt();
        int d1=cin.nextInt();
        int d2=cin.nextInt();
        boolean f=false;
        loop:{
        for(int g1=1;g1<21;g1++){
            for(int g2=1;g2<21;g2++){
                for(int g3=1;g3<21;g3++){
                    for(int g4=1;g4<21;g4++){
                        if(g1+g2==r1&&g3+g4==r2&&g1+g3==c1&&g2+g4==c2&&g1+g4==d1&&g2+g3==d2){
                            if(g1!=g2&&g1!=g3&&g1!=g4&&g2!=g3&&g2!=g4&&g3!=g4){
                            cout.println(g1+" "+g2);
                            cout.println(g3+" "+g4);
                            f=true;
                           break loop;
                            }
                    }
                }
                
            }
            }
        }
        }
        if(f==false){
         cout.println("-1");   
        }
     }
}