r1,r2 = map(int,input().split())
c1,c2 = map(int,input().split())
d1,d2 = map(int,input().split())
a=0 ;b=0;c=0;d=0
if (r1+c1-d2)%2==0:
    a = (r1+c1-d2)//2
if (r1+c2-d1)%2==0:
    b = (r1-d1+c2)//2
c = c1-a
d = d1-a
if 0<a<10 and  0<b<10 and 0<c<10 and 0<d<10 and a!=b and c!=d:
    print(a,b)
    print(c,d)
else:
    print(-1)