# HELP VASILISA THE WISE 2
# Estacio Pereira, estacio.neto@ccc.ufcg.edu.br
# UFCG

# INPUT
r = raw_input().split()
r1, r2 = int(r[0]), int(r[1])
c = raw_input().split()
c1, c2 = int(c[0]), int(c[1])
d = raw_input().split()
d1, d2 = int(d[0]), int(d[1])

# PROCESS
x1 = r1 - 1
x2 = r2 - 1
y1 = 1
y2 = 1
igual1 =  False
if r1 == 1 or r2 == 1 or c1 == 1 or c2 == 1 or d1 == 1 or d2 == 1:
	print -1
	igual1 = True
else:
        while c1 != (x1 + x2):
                if d1 != x1 + y2 and x1 > 1:
                        x1 -= 1
                        y1 += 1
                        if d2 - y1 > 0 and d1 - x1 > 0:
                            x2 = d2 - y1
                            y2 = d1 - x1
                if x1 == 1 or d1 == x1 + y2: break
# OUTPUT
if x1 == x2 or x1 == y1 or x1 == y2 or x2 == y1 or x2 == y2 or y1 == y2:
	if not igual1:
		print -1	
elif c1 == x1 + x2 and c2 == y1 + y2 and r1 == x1 + y1 and r2 == x2 + y2 and d1 == x1 + y2 and d2 == y1 + x2 and x1 < 10 and x2 < 10 and y1 < 10 and y2 < 10:
	print x1, y1
	print x2, y2
elif not igual1:
	print -1


