
#include <bits/stdtr1c++.h>
bool checkEqual( int A , int B , int C , int D){

if( A==B || A==C || A==D || B==C || B==D  || A>9 || B>9 || C>9 || D>9 )
    return true;
else
    return false;
}
using namespace std;
int main(){
int r1 , r2 , c1 , c2 , d1 ,d2 , A ,B ,C ,D;
cin>>r1>>r2>>c1>>c2>>d1>>d2;

 B=(d2+c2-r2)/2;
 A=r1-B;
 C=d2-B;
 D=c2-B;

 if(A<=0 || B<=0 || C<=0 || D<=0 )
    cout<<"-1"<<endl;

else if (checkEqual(A , B , C ,D)==true)
     cout<<"-1"<<endl;

 else
   {
       cout<<A<< " " << B <<endl;
       cout<<C<< " " << D <<endl;
    }
}
