#!/bin/python

import sys


n = int(raw_input().strip())
a = []
for a_i in xrange(n):
    a_temp = map(int,raw_input().strip().split(' '))
    a.append(a_temp)

sum1 = [0][0]
sum2 = [0][0]
for i in range (0, n):
    for j in range (0, n):
        if i == j:
            temp1 = a[i][j]
            print temp1
            sum1 = sum1 + temp1
            
for i in range (0, n):
    for j in range (0, n):
        if i+j == n-1:
            temp2 = a[i][j]
            print temp2
            sum2 = sum2 + temp2
            
print sum1
print sum2
print abs(sum1-sum2) 
        