n = int(input())
counter = 0
s = 0
for i in range(n):
    entries = list(map(int, input().split()))
    s += entries[counter]
    counter += 1
print(s)

1023763574fefb65783f88ec79b67e759bb691ce
<mask token>

<mask token>
for i in range(n):
    entries = list(map(int, input().split()))
    s += entries[counter]
    counter += 1
print(s)

n = int(input())
counter = 0
s = 0
for i in range(n):
    entries = list(map(int, input().split()))
    s += entries[counter]
    counter += 1
print(s)
