r = int(input())
g = int(input())
print((g - r) + g)
2d22056e8b8db958f4718400d4c754b1ccf50ca9
<mask token>

<mask token>
print(g - r + g)

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

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