r = int(eval(input()))

g = int(eval(input()))



print((g + (g - r)))
r = int(eval(input()))

g = int(eval(input()))

print((2 * g - r))
r = int(eval(input()))
g = int(eval(input()))
print((g + (g - r)))

r = int(eval(input()))
g = int(eval(input()))
print((2 * g - r))

-print((g + (g - r))) +print((2 * g - r))