#include<iostream>
#include<memory.h>
using namespace std;
#define HARDEST 10000
#define EASYEST -1
int flags[100];
int inputBuffer[100];
int main(int argc, char *argv[]){
memset(flags,0,100*sizeof(int));
int n,p;
cin>>n>>p;
for(int i=0;i<n;i++){
int easyest=HARDEST;
int hardest=EASYEST;
for(int j=0;j<p;j++){
cin>>inputBuffer[j];
if(inputBuffer[j]<easyest){
easyest=inputBuffer[j];
}
if(inputBuffer[j]>hardest){
hardest=inputBuffer[j];
}
}
for(int m=0;m<p;m++){
if(flags[m]!=-1){
if(inputBuffer[m]==easyest){
flags[m]+=1;
}
if(inputBuffer[m]==hardest){
flags[m]=-1;
}
}
// cout<<flags[m]<<" ";
}
// cout<<endl;
}
bool hasEasyest=false;
for(int n=0;n<p;n++){
if(flags[n]>p/2){
if(hasEasyest){
cout<<" ";
}
cout<<n+1;
hasEasyest=true;
}
}
if(!hasEasyest){
cout<<0;
}
cout<<endl;
return 0;
}