A, B = list(map(int, input().split()))

if A >= 13:

    print(B)

elif A <= 12 and A >= 6:

    print((B//2))

else:

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



if a >= 13:

	print(b)

elif a <= 5:

	print((0))

else:

	print((b//2))
A, B = list(map(int, input().split()))
if A >= 13:
    print(B)
elif A <= 12 and A >= 6:
    print((B // 2))
else:
    print((0))

a, b = list(map(int, input().split()))
if a >= 13:
    print(b)
elif a <= 5:
    print((0))
else:
    print((b // 2))

-A, B = list(map(int, input().split())) -if A >= 13: -    print(B) -elif A <= 12 and A >= 6: -    print((B // 2)) +a, b = list(map(int, input().split())) +if a >= 13: +    print(b) +elif a <= 5: +    print((0)) -    print((0)) +    print((b // 2))