 program SIMPLE;
 type     mark=0..1000;
          zad=0..100;
          massiv=array[1..100,1..100] of mark;
 var A:massiv;
     i,j:integer;
     n,br:integer;
     p:zad;
     NotBest:boolean;

 function Min(i:integer;A:massiv;p:zad):mark;
  var c,d:integer;
   begin
    Min:=A[i,1];
    for c:=1 to p do
     if Min>A[i,c] then Min:=A[i,c];
   end;

  function Max(i:integer;A:massiv;p:zad):mark;
   var c,d:integer;
    begin
     Max:=A[i,1];
     for c:=1 to p do
      if Max<A[i,c] then Max:=A[i,c];
    end;

 begin
  NotBest:=true;
  br:=0;
  readln(n,p);
  for i:=1 to n do
   for j:=1 to p do
    read(A[i,j]);
    writeln;
  for j:=1 to p do
   begin
    for i:=1 to n do
     begin
      if min(i,A,p)=A[i,j] then br:=br+1
       else if max(i,A,p)=A[i,j] then NotBest:=false;
     end;
    if (br>=n div 2)and(NotBest=true) then write(j,' ');
    NotBest:=true;
   end;
  readln;
  readln;
end.
