r1, r2 = map(int, raw_input().split())
c1, c2 = map(int, raw_input().split())
d1, d2 = map(int, raw_input().split())
x2 = (r1-c1+d2)/2
x1 = r1 - x2
x3 = d2 - x2
x4 = c2 - x2
xs = (x1,x2,x3,x4)
if len(set(xs)) == 4 and max(xs)<10 and min(xs)>0:
  print x1, x2
  print x3, x4
else:
  print -1
