#include "stdio.h"
#include "math.h"
int aver1(int a,int b,int c)
{
int average1;
average1=(a+b+c)/3;
return average1;
}
int aver2(int a,int b,int c,int d,int e)
{
int average2;
average2=(a+b+c+d+e)/5;
return average2;
}
int main(int argc, char* argv[])
{
int i,j,x,y;
int a[5][3];
for(i=0;i<5;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("
");
for(i=0;i<5;i++)
{
x=aver1(a[i][0],a[i][1],a[i][2]);
printf("%d
",x);
}
printf("
");
for(j=0;j<3;j++)
{
y=aver2(a[0][j],a[1][j],a[2][j],a[3][j],a[4][j]);
printf("%d
",y);
}
return 0;
}