import java.util.*; public class Main { public static void main(String[] args) { // TODO code application logic here Scanner shuru=new Scanner(System.in); int [][] a; int i,j,n,he=0,he2=0; n = shuru.nextInt(); a = new int [n][n]; for(i=0;i<n;i++) { for(j=0;j<n;j++) { a[i][j] = shuru.nextInt(); } } for(i=0;i<n;i++) { he = he+a[i][n-1-i]; } for(i=0;i<n;i++) { he2 = he2+a[i][i]; } System.out.println(he2+" "+he); } }