#include<stdio.h>int main(){int a[3][3];int i,j,b,c,k=0;b=0;c=0;for(i=0;i<3;i++)for(j=0;j<3;j++){scanf("%d",&a[i][j]);if(i==j)b+=a[i][j];if(i+j==2)c+=a[i][j];}
printf("%d %d\n",b,c);return 0;}