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



if A <= 5:

    print((0))

elif A <= 12:

    print((B//2))

else:

    print(B)

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



if A <= 5:

    B = 0

elif A <= 12:

    B //= 2



print(B)

A, B = list(map(int, input().split()))
if A <= 5:
    print((0))
elif A <= 12:
    print((B // 2))
else:
    print(B)

A, B = list(map(int, input().split()))
if A <= 5:
    B = 0
elif A <= 12:
    B //= 2
print(B)

-    print((0)) +    B = 0 -    print((B // 2)) -else: -    print(B) +    B //= 2 +print(B)