from sys import stdin

t = tuple()
for line in stdin:
    if line.startswith("=="): 
        print(mat_sum(t))
        t = tuple()
    else:
        t += ( tuple(map(int, line.split())), )