f = lambda:map(int,raw_input().split())
r1,r2 = f()
c1,c2 = f()
d1,d2 = f()
a = (r1+c1-d2)/2
b = (r1+c2-d1)/2
c = (c1+r2-d1)/2
d = (r2+c2-d2)/2
if(a<=0 or b<=0 or c<=0 or d<=0 or(a==b==c==d)):
    print -1
else:
    print a,b
    print c,d