from sys import stdin as I

r1,r2 = map(int, I.readline().split())
c1,c2 = map(int, I.readline().split())
d1,d2 = map(int, I.readline().split())

if (c1-r2+d1) % 2:
    print -1
else:
    a = (c1-r2+d1) / 2
    b = r1 - a
    c = c1 - a
    d = r2 - c

    v = [a,b,c,d]
    if 0 <= min(v) and max(v) <= 9 and len(set(v)) == 4:
        print a, b
        print c, d
    else:
        print -1