program simple;
var n,p:byte;
    i,j,t,min,pom:word;
    A:array[1..100,1..100] of word;
    psb:array[1..100] of shortint;

begin
     readln(n,p);
     for i:=1 to 100 do begin
         for j:=1 to 100 do A[i,j]:=0;
         psb[i]:=0;
     end;
     for i:=1 to n do begin
         t:=0; min:=1001;
         for j:=1 to p do begin
             read(A[i,j]);
             if t<A[i,j]
                then t:=a[i,j];
             if min>A[i,j]
                then min:=a[i,j];
         end;
         readln;
         for j:=1 to p do begin
             if (A[i,j]=t) and (t<>min)
                then psb[j]:=-1;
             if (A[i,j]=min) and (A[i,j]<>-1)
                then inc(psb[j]);
         end;
     end;

     if (n mod 2)=0
        then pom:=n div 2
        else pom:=(n div 2) +1;
     for i:=1 to 100 do
         if psb[i]>=pom
            then write(i,' ');
     writeln;
end.