r = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
d = [int(x) for x in input().split()]

out1_0 = 0
out1_1 = 0

out2_0 = 0
out2_1 = 0

for i in range(1,19):
  out1_0 = i
  out1_1 = c[0] - out1_0

  out2_0 = r[0] - out1_0
  out2_1 = r[1]- out1_1

  if (out1_0 + out2_1 == d[0] or out1_1 + out2_0 == d[1]):
    print(out1_0 ,  out2_0)
    print(out1_1, out2_1)
    break
  else:
    i = i + 1
print(-1)