#include  <iostream.h>

long N,P;	//juri, zada4i
long *easy,*hard,val[100][100];

void Read();
void Solve();

long main()
{
	Read();
	Solve();

	return 0;
}

void Read()
{
	cin>>N>>P;

	easy=new long[N];
	hard=new long[N];

	long min=32767,max=0,c,i,j;
	
	for(i=0;i<N;i++)
	{
		min=32767;
		max=0;

		for(j=0;j<P;j++)
		{
			cin>>c;

			if(c>max) max=c;
			if(c<min) min=c;
			val[i][j]=c;
		}

		easy[i]=min;
		hard[i]=max;
	}
}

void Solve()
{
	long i,j;
	long easyvotes=0,hardvote=0;

	for(i=0;i<P;i++)
	{
		easyvotes=hardvote=0;

		for(j=0;j<N;j++)
		{
			if(val[j][i]==easy[j])
				easyvotes++;
			if(val[j][i]==hard[j])
				{ hardvote=1; break; }
		}

		if( (easyvotes>=(N/2)) && (!hardvote)) cout<<i+1<<' ';
	}

	cout<<endl;
}