R, G = (int(eval(input())) for i in range(2))

print((G * 2 - R))
print((-int(eval(input())) + int(eval(input())) * 2))

R, G = (int(eval(input())) for i in range(2))
print((G * 2 - R))

print((-int(eval(input())) + int(eval(input())) * 2))

-R, G = (int(eval(input())) for i in range(2)) -print((G * 2 - R)) +print((-int(eval(input())) + int(eval(input())) * 2))