t=c=0

for _ in[0]*int(eval(input())):i=int(eval(input()));c+=(i+t)//2;t=(i+t)%2&(i>0)

print(c)
s=t=0

for _ in[0]*int(eval(input())):a=int(eval(input()));s+=(a+t)//2;t=(a+t)%2&(a>0)

print(s)
t = c = 0
for _ in [0] * int(eval(input())):
    i = int(eval(input()))
    c += (i + t) // 2
    t = (i + t) % 2 & (i > 0)
print(c)

s = t = 0
for _ in [0] * int(eval(input())):
    a = int(eval(input()))
    s += (a + t) // 2
    t = (a + t) % 2 & (a > 0)
print(s)

-t = c = 0 +s = t = 0 -    i = int(eval(input())) -    c += (i + t) // 2 -    t = (i + t) % 2 & (i > 0) -print(c) +    a = int(eval(input())) +    s += (a + t) // 2 +    t = (a + t) % 2 & (a > 0) +print(s)