type
 arrmarks=Array[1..100] of integer;
 armarks=array[1..100] of arrmarks;

var
 n:Longint;
 p:byte;
 marks:armarks;

procedure fillnull(var marks:armarks);
var
 i:longint;
 j:byte;
begin
 for i:=1 to 100 do for j:=1 to 100 do marks[i][j]:=0;
end;

function ismax(no:Integer;marks:armarks):Boolean;
var
 i:longint;
 j:Byte;
 carry:boolean;
 c1:Integer;
begin
 carry:=false;
 for i:=1 to n do
 begin
  c1:=0;
  for j:=1 to p do
  begin
   {if marks[i][j]<marks[i][no] then carry:=true;}
   if marks[i][j]>c1 then c1:=marks[i][j];
  end;
  if marks[i][no]>=c1 then carry:=true;
 end;
 ismax:=carry;
end;

function ismin(no:Integer;marks:armarks):Integer;
var
 i:longint;
 j:Byte;
 c1,carry:Integer;
begin
 carry:=0;
 for i:=1 to n do
 begin
  c1:=1000;
  for j:=1 to p do
  begin
   {if marks[i][j]<marks[i][no] then carry:=true;}
   if marks[i][j]<c1 then c1:=marks[i][j];
  end;
  if marks[i][no]<=c1 then inc(carry);
 end;
 ismin:=carry;
end;

procedure readmarks(var marks:armarks;n:longint;p:byte);
var
 i:longint;
 j:byte;
 carry:integer;
begin
 for i:=1 to n do
 begin
  for j:=1 to p do
  begin
   read(carry);
   marks[i][j]:=carry;
  end;
 end;
end;

procedure findsimple(marks:armarks;n:longint;p:byte);
var i:byte;
begin
 for i:=1 to p do
 begin
  if (ismax(i,marks)=false) and ((ismin(i,marks))>=n/2) then write(i,' ');
 end;
 writeln;
end;

begin
 fillnull(marks);
 read(n);
 read(p);
 readmarks(marks,n,p);
 findsimple(marks,n,p);
end.
