{Ilian Ivanov, C gr., MG'Baba Tonka'}
var
n,p,i,j,max,min:integer;
minimal,maximal,temp:array[1..1100]of integer;
begin
readln(n,p);
for i:=1 to n do
    begin
    for j:=1 to p do
        read(temp[j]);
    min:=1001;
    max:=0;
    for j:=1 to p do
        begin
        if min>temp[j]
        then min:=temp[j];
        if max<temp[j]
        then max:=temp[j];
        end;
    for j:=1 to p do begin
    if temp[j]=min
    then inc(minimal[j]);
    if temp[j]=max
    then inc(maximal[j]);
    end;
    end;
for i:=1 to p do
    if ((n mod 2=0)and(minimal[i]>=n div 2))or((n mod 2=1)and(minimal[i]>=(n div 2)+1))
    then if maximal[i]=0
         then write(i,' ');
end.