#include <iostream.h>

int min_element(int* a,int length);
int max_element(int* a,int length);
int hard[100],easy[100];
int n,p,i,j,min,max;

int main()
{
	cin>>n>>p;
	int *marks=new int[p+1];
	for(j=0;j<n;j++)
	{
		for(i=0;i<p;i++)cin>>marks[i];
		min=min_element(marks,p);
		max=max_element(marks,p);
		for(i=0;i<p;i++)
		{
			if(marks[i]==marks[min])easy[i]++;
			if(marks[i]==marks[max])hard[i]++;
		}
	}
	for(i=0;i<p;i++)
	{
		if(easy[i]>=p/2&&hard[i]==0)cout<<i+1<<" ";
	}
	cout<<"\n";
	return 0;
}
int min_element(int* a,int length)
{
	int current=a[0],position=0,i;
	for(i=1;i<length;i++)
		if(a[i]<current)
		{
			current=a[i];
			position=i;
		}
	return position;
}
int max_element(int* a,int length)
{
	int current=a[0],position=0,i;
	for(i=1;i<length;i++)
		if(a[i]>current)
		{
			current=a[i];
			position=i;
		}
	return position;
}