#include<stdio.h>

#include<string.h>

double student[55],subject[9],sore[55][9];

int main(){

         int m,n;

         while(scanf("%d%d",&m,&n)!=EOF){

                   for(int i=0;i<n;i++)

                      for(int j=0;j<m;j++){

                            scanf("%lf",sore[i][j]);

                   }

         }

         float sumstu,sumobj,avestu,ave[9];

         for(int i=0;i<n;i++)

                   for(int j=0;j<m;j++){{

                            sumstu+=sore[i][j];

                            avestu=sumstu/m;}

                   printf("%.2f",avestu);     

                   }

         for(int j=0;j<m;j++)

                   for(int i=0;i<n;i++){{

                            sumobj+=sore[i][j];

                            ave[j]=sumobj/n;}

                   printf("%.2f",ave[j]);       

                   }

         int num=0;

         for(int j=0;j<m;j++)

                   for(int i=0;i<n;i++){{

                      if(sore[i][j]!=ave[j])

                            num+=1;}

                   printf("%d",num);   

                   }       

         return 0;

}