

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

x1,y1,x2,y2=(r1-c2+d1)/2,(d2-c1+r1)/2,(c1-r1+d2)/2,(d1-r1+c2)/2
if (x1==y1 or x1==x2 or x1==y2 or y1==x2 or y1==y2 or x2==y2) or x1>9 or x2>9 or y1>9 or y2>9:
	print "-1"
else:
	print x1,y1
	print x2,y2 

