r1, r2 = map(int, input().split())
c1, c2 = map(int, input().split())
d1, d2 = map(int, input().split())
a = (d1 + c1 - r2) // 2
b = (d2 + c2 - r2) // 2
c = (c1 + d2 - r1) // 2
d = (c2 + r2 - d2) // 2
e = [a, b, c, d]
if e.count(a) + e.count(b) + e.count(c) + e.count(d) == 4 and a != b and b != c and c != d and a != d and a != c and b != d:
    print(a, b)
    print(c, d)
else:
    print(-1)

# Wed Oct 14 2020 15:41:28 GMT+0300 (Москва, стандартное время)
