a,b=list(map(int, input().split()))



print((max(a-2*b,0)))
a,b = list(map(int,input().split()))

print((max(0,a-b*2)))
a, b = list(map(int, input().split()))
print((max(a - 2 * b, 0)))

a, b = list(map(int, input().split()))
print((max(0, a - b * 2)))

-print((max(a - 2 * b, 0))) +print((max(0, a - b * 2)))