data = []
for i in range(3):
    data += map(int, raw_input().split())
[r1,r2,c1,c2,d1,d2] = data
a = (r1+c1-d2)/2
if ((r1+r2) == (c1+c2) == (d1+d2) < 18) and (a == int(a)):
    b = r1 - a
    c = c1 - a
    d = d1 - a
    print "%d %d\n%d %d" %(a,b,c,d)
else:
    print "-1"
