r1, r2 = map(int, raw_input().split())
c1, c2 = map(int, raw_input().split())
d1, d2 = map(int, raw_input().split())
a1 = ((r1 + c1 - d2) / 2)
a2 = (r1 - (r1 + c1 - d2) / 2)
a3 = c1 - ((r1 + c1 - d2) / 2)
a4 = c2 - (r1 - (r1 + c1 - d2) / 2)
if(a1 < 1 or a2 < 1 or a3 < 1 or a4 < 1):
    print "-1"
else:
    print(str(a1) + " " + str(a2))
    print(str(a3) + " " + str(a4))
