var a:Array[1..100,1..100] of Word;
    prosti,min,max:Array[0..100] of Longint;
    i,j,br,n,p,k:Longint;
    maxed:Boolean;
Begin
 For i:=1 to 100 do min[i]:=3000;
 For i:=1 to 100 do max[i]:=-3000;
  ReadLn(n,p);
 For j:=1 to p do
  For i:=1 to n do
  Begin
    Read(a[i,j]);
   If a[i,j]<min[j] then min[j]:=a[i,j];
   If a[i,j]>max[j] then max[j]:=a[i,j];
  End;
 For i:=1 to p do
 Begin
   br:=0;
   maxed:=false;
  For j:=1 to n do
  Begin
   If a[i,j]=min[j] then br:=br+1;
   If a[i,j]=max[j] then Begin
                           maxed:=True;
                           Break;
                         End;
  End;
  if maxed then continue;
  if br>=(n div 2) then
  Begin
    prosti[0]:=prosti[0]+1;
    prosti[prosti[0]]:=i;
  End;
 End;
 If Prosti[0]>0 then
 Begin
  For i:=1 to prosti[0] do
   if i=1 then Write(prosti[i]) else Write(' ',prosti[i]);
   ReadLn;
   Halt(0);
 End;
End.