#include<stdio.h>
int main(){
int N,P,i,j,ocenka_za_nai_prosto,br_score,br_score2,score[100],score2[100];
scanf("%d%d",&N,&P);
br_score2=ocenka_za_nai_prosto=0;
for(i=0;i<N;i++)
 {
 for(j=0,ocenka_za_nai_prosto=0;j<P;j++)
 {
  scanf("%d",&score[j]);
  if(ocenka_za_nai_prosto<score[j]) ocenka_za_nai_prosto=score[j];
 }
  for(j=0,br_score=0;j<P;j++)
	  {
	  if(score[j]==ocenka_za_nai_prosto) br_score++;
	  else if(score[j]==1) {br_score=0;break;}
	  }
	  if(P/2<br_score) {score2[br_score2]=i+1;br_score2++;}
 }
 for(i=0;i<br_score2;i++)
   printf("%d ",score2[i]);

return 0;
}
