def search(n,r1,r2,c1,c2,d1,d2):
	x2=abs(r1-n)
	x3=abs(c1-n)
	x4=abs(d1-n)
	count = 0
	if x2+x3==d2:
		count += 1
	if x3+x4==r2:
		count += 1
	if x2+x4==c2:
		count += 1
	if count==3:
		return [n,x2,x3,x4]
	return [1]
s=raw_input()
s=s.split()
r1=int(s[0])
r2=int(s[1])
s=raw_input()
s=s.split()
c1=int(s[0])
c2=int(s[1])
s=raw_input()
s=s.split()
d1=int(s[0])
d2=int(s[1])
i=1
l=[0]
while i<d1 and len(l)==1:
	l=search(i,r1,r2,c1,c2,d1,d2)
	# print l
	i += 1
if len(l) > 1:
	if l[0] != l[1] and l[0] != l[2] and l[0] != l[3] and l[1] != l[2] and l[1] != l[3] and l[2] != l[3] and l[0]!=0 and l[1] != 0 and l[2]!=0 and l[3]!=0:
		print l[0],l[1]
		print l[2],l[3]
	else:
		print "-1"
else:
	print "-1"