r1,r2 = map(int, raw_input().split())
c1,c2 = map(int, raw_input().split())
d1,d2 = map(int, raw_input().split())

m = (c1+r2-d1)/2
n = (r2+d1-c1)/2
l = (2*c2-r2-d1+c1)/2
k = (c1-r2+d1)/2
g = len(set([k,l,m,n]))
if k+n==d1 and l+m==d2 and k+l==r1 and m+n==r2 and k+m==c1 and l+n==c2 and g==4:
    print k,l
    print m,n
else:
    print -1