#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ll long long
#define PI 3.141592653589
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define EPS 1e-7
#define ff first
#define ss second
#define mp make_pair
#define all(v) v.begin(),v.end()
#define print(val) "[ " << #val ": " << (val) << " ]\n"
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;
const int MOD = 1e9;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int random_int(int l,int r){return uniform_int_distribution<int>(l,r)(rng);}
struct Debug;
template<typename T, typename C = std::ostream&>
struct hasPrint : false_type{};
template<typename T>
struct hasPrint<T, decltype(cout << declval<T>())>: true_type{};
struct Debug{
    template<typename T>
    typename enable_if<hasPrint<T>::value, Debug&>::type operator << (const T& t){
        cerr << t;
        return *this;
    }
    template<typename T>
    typename enable_if<!hasPrint<T>::value, Debug&>::type operator << (const T& t){
        auto ed = t.end();
        *this << "[";
        for(auto it = t.begin(); it != ed; it++){
            if(next(it) == ed){
                *this << *it; continue;
            }
            *this << *it << ", ";
        }
        *this << "]";
        return *this;
    }
    template<typename T, typename C>
    Debug& operator << (const pair<T,C>& t){
        *this << "[ " << t.first << ", " << t.second << " ]";
        return *this;
    }
};
ll fast_power(ll x, ll p){
    ll res = 1;
    while(p > 0){
        if(p & 1){
            res = (res * x)%MOD;
        }
        p = p >> 1;
        x = (x*x)%MOD;
    }
    return res;
}
int n;
int main(){
	IO;
	int t;
	//cin >> t;
	t=1;
	while(t--){
        int r1, r2, c1, c2, d1, d2;
        cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
        int n3 = (c1-r1+d2)/2;
        int n1 = c1-n3, n2 = d2-n3, n4 = r2-n3;
        if(n1+n2==r1 && n3+n4==r2 && n1+n3==c1 && n2+n4==c2 && n1+n4==d1 && n2+n3==d2){
            cout << n1 << ' ' << n2 << '\n';
            cout << n3 << ' ' << n4 << '\n';
        }else{
            cout << -1;
        }
    }
}


