var
 i,j,n,p:longint;
 max,min:integer;
 z:array [1..100] of boolean;{potencialni}
 k:array [1..100] of longint; {kolko glasa za sqka zad da e simplest}
 t,ans:array [1..100] of word;
begin
  fillchar (z,sizeof(z),true);
  readln (n,p);
  for i:=1 to n do
   begin
     min:=101; max:=-1;
     for j:=1 to p do
      begin
        read (t[j]);
        if t[j]<min then min:=t[j];
        if t[j]>max then max:=t[j];
      end;
     for j:=1 to p do
      if t[j]=max then z[j]:=false
      else if t[j]=min then inc(k[j]);
   end;
  j:=0;
  for i:=1 to p do
   if z[i] then
    if k[i]>=n div 2+n mod 2 then
     begin inc(j); ans[j]:=i; end;

  for i:=1 to j-1 do
   write (ans[i],' ');
  writeln (ans[j]);
end.