summ = 0
while 1:
a = int(input("a: "))
if a == 0:
break
elif a > 0:
if a % 2 == 0:
summ += a
print(summ)
summ = 0
while 1:
a = int(input("a: "))
if a == 0:
break
elif a > 0:
if a % 2 == 0:
summ += a
print(summ)