r1,r2=map(int,input().split())
c1,c2=map(int,input().split())
d1,d2=map(int,input().split())
re=[c1+d1+r1,c2+d2+r1,c1+r2+d2,c2+d1+r2]
x=min(re)
re1=[]
cnt=0
for i in range(len(re)):
    re[i]=((re[i]-x)/2)+1
    re1.append(int(re[i]))
for j in range(3):
    if re1[j]!=re1[j+1]:
        cnt+=1
if cnt!=3:
    print(-1)
else:
    print(re1[0],re1[1])
    print(re1[2],re1[3])