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

p += a * 3

print((int(p/2)))
a, p = list(map(int, input().split()))

p += a * 3

print((p//2))
a, p = list(map(int, input().split()))
p += a * 3
print((int(p / 2)))

a, p = list(map(int, input().split()))
p += a * 3
print((p // 2))

-print((int(p / 2))) +print((p // 2))