var a:array[byte,1..100] of word;
    m:array[1..100] of boolean;
    count:array[1..100] of byte;
n,p,z:byte;

Procedure Input;
var i,k:byte;
Begin
Readln(n,p);
For i:=1 to n do
              for k:=1 to p do read(a[i,k]);
for i:=1 to p do m[i]:=true;
for i:=1 to p do count[i]:=0;
End;

Function most(h:byte):word;
var i:byte;
max:word;
Begin
max:=a[h,1];
For i:=1 to p do if a[h,i]>max then max:=a[h,i];
most:=max;
End;

Function least(h:byte):word;
var i:byte;
min:word;
Begin
min:=a[h,i];
For i:=1 to p do if a[h,i]<min then min:=a[h,i];
least:=min;
End;

Procedure remove;
var i,j:byte; {red,kolonka}
Begin
j:=1;
For i:=1 to n do
 begin
 repeat
 if a[i,j]=most(i) then m[j]:=false;
 inc(j);
 Until (j>p);
 end;
End;

Procedure choose;
var i,j:byte;
Begin
for i:=1 to n do
              for j:=1 to p do
                            If m[j] then if a[i,j]=least(i) then
                                                            inc(count[j]);


End;
{Procedure IsSimple;
var i:byte;
    j:byte;
Begin
i:=0;
repeat
inc(i);
if a[i]<a[i-1] then begin inc(m[i]);for j:=(i-1) downto 1 do if m[j]<>0 then dec(m[j]);end;
if a[i]=a[i-1] then inc(m[i]);
Until i=p;
End;             }


{Procedure FindSimplest;
var i,j:byte;
    b:boolean;
Begin
IsSimple;
i:=1;
tr[i]:=true;
repeat
inc(i);
if m[i]<m[i-1] then begin for j:=(i-1) downto 1 do tr[j]:=false;tr[i]:=true;end;
if m[i]=m[i-1] then tr[i]:=true;
Until i=p;
End;   }



BEGIN
input;
remove;
choose;
for z:=1 to p do begin if m[z] {and (count[z])>=((n div 2)+(n mod 2))}  then write(z,' ');end;
END.