#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
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]

if a[0][0] + a[0][1] != r1 or a[1][0] + a[1][1] != r2 or\
   a[0][0] + a[1][0] != c1 or a[0][1] + a[1][1] != c2 or\
   a[0][0] + a[1][1] != d1 or a[0][1] + a[1][0] != d2:
  print -1
else:
  all = [i for v in a for i in v]
  if len(set(all)) < 4 or any(i < 0 or i > 9 for i in all):
    print -1
  else:
    for v in a:
      print v[0], v[1]
