
import sys

def read2():
   return map(int, raw_input().split())

r1, r2 = read2()
c1, c2 = read2()
d1, d2 = read2()

for i in range(1, r1):
   a, b, c, d = i, r1 - i, c1 - i, d1 - i
   if a == b or a == c or a == d or b == d or c == d or b == c:
      continue
   if c + b == d2 and b + d == c2 and c + d == r2:
      print a, b
      print c, d
      sys.exit(0)

print -1
