In the square table N
xN
, calculate the sums of the numbers on the diagonals.
Input
The first line contains the number N
(1<=N<=100) and then the matrix N
xN
. Matrix elements are numbers that do not exceed 32767 in absolute value.
Output
First print the sum of the numbers on the main diagonal, and then, one space later, on the secondary diagonal.
Examples
# |
Input |
Output |
1 |
3
1 2 3
4 5 6
10 9 8
|
14 18 |