r1,r2 = map(int,input().split())
c1,c2 = map(int,input().split())
d1,d2 = map(int,input().split())
'''
x+y = r1
z+w = r2  #...
x+z = c1 
y+w = c2  #...
x+w = d1
z+y = d2  #...
'''

z = (r2-c2+d2)//2 #...
w = r2-z
y = d2-z
x = r1-y
#print(len(set([x,y,z,w])) == 4)
if(x>=1 and y>=1 and z>=1 and w>=1):
    if(len(set([x,y,z,w]))==4):
       print(x,y)
       print(z,w)
    else:
        print(-1)
else:
    print(-1)

