r, t, c, v, d, f = (int(x) for i in '123' for x in raw_input().split())
w, x, y, z = r+c-f, r+v-d, t+c-d, t+v-f
print -1 if len(set([w,x,y,z])) < 4 or any(n%2 or n<2 or n>18 for n in [w,x,y,z]) \
    else "%d %d\n%d %d" % (w/2, x/2, y/2, z/2)