#br = open('a.in')
f = lambda: map(int, raw_input().strip().split())
r1, r2 = f()
c1, c2 = f()
d1, d2 = f()

v = c1 + d2 - r1
if v % 2 != 0:
  print -1
else:
  a = [[0, 0], [v / 2, 0]]
  a[0][0] = c1 - a[1][0]
  a[0][1] = d2 - a[1][0]
  a[1][1] = c2 - a[0][1]
  s = set()
  for v in a:
    s.add(v[0])
    s.add(v[1])
    if any(b < 0 or b > 9 for b in v):
      print -1
      exit()
  if len(s) == 4:
    for v in a:
      print v[0], v[1]
  else:
    print -1
