r1,r2 = map(int,input().split())
c1,c2 = map(int,input().split())
d1,d2 = map(int,input().split())
maxi = max(r1,r2,c1,c2,d1,d2)
mini = min(r1,r2,c1,c2,d1,d2)
if ((maxi > 17) or (mini < 3) or (r1 + r2 != c1 + c2) or (r1 + r2 != d1 + d2)):
    print(-1)
else:
    x = (d1 + c1 - r1) / 2
    if x != int(x): 
        print(-1)
    else:
        a = r1 - x
        b = c1 - x
        c = d1 - x
        if ((x == a) or (x == b) or (x == c) or (a == b) or (a == c) or (b == c)):
            print(-1)
        else:
            print(str(int(x)) + " " + str(int(a)))
            print(str(int(b)) + " " + str(int(c)))