var i,n,p,k:byte;
    o:array[1..100] of integer;
    m:array[1..100] of integer;

 procedure ocenka;
  var max,j:byte;
      l:integer;
  begin
   for j:=1 to p do
    begin
     read(l);
     max:=0;
     if l>max then max:=j;
     o[j]:=o[j]+l;
    end;
   m[k]:=max;
  end;

function lookm(s:byte):boolean;
 var j:byte;
     f:boolean;
  begin
   f:=true;
   for j:=1 to k do if s=m[j] then
                               begin
                                f:=false;
                                exit;
                               end;
  end;

function minall:byte;
 var j:byte;
     min:integer;
  begin
   min:=1001;
   for j:=1 to p do
                     if lookm(j) and (o[j]<min) then min:=j;
   minall:=min;
  end;

BEGIN
 k:=0;
 readln(n,p);
 for i:=1 to n do
  begin
   inc(k);
   ocenka;
  end;
  writeln(minall);
END.