r1, r2 = [int(y) for y in input().split()]
c1, c2 = [int(y) for y in input().split()]
d1, d2 = [int(y) for y in input().split()]
a = (r1+c1-d2)//2
b = r1 - a
c = c1 - a
d = d1 - a
print(a,b)
print(c,d)