var p:byte;
    n,i,j,tmax,t,brt,g,tmin:longint;
    mas:array [1..201]of integer;
    brpz:integer;
    zad:array [1..101] of integer;
begin
     for i:=1 to 100 do
         zad[i]:=0;
     readln(n,p);
     brpz:=0;
     for i:=1 to n do
     begin
         for j:=1 to p do
             read(mas[j]);

         tmax:=0;
         for j:=1 to p do
             if mas[j]>tmax then tmax:=mas[j];

         for j:=1 to p do
             if (tmax=mas[j]) then zad[j]:=-1;

         tmin:=1001;
         for j:=1 to p do
             if mas[j]<tmin then tmin:=mas[j];

         for j:=1 to p do
             if (tmin=mas[j])and(zad[j]<>-1) then zad[j]:=zad[j]+1;
     end;
     for i:=1 to 100 do
         if zad[i]>=p/2 then write(zad[i] ,' ');

end.