const fi='input.txt'
fo='output.txt'
var f1,f2:text;
a:array[1..100,1..100]of integer;
i,n,m,j,max:integer;
begin
assign(f1,fi); reset(f1);
assign(f2,fo); rewrite(f2);
readln(f1,n,m);
for i:=1 to n do
begin
for j:=1 to m do
read(f1,a[i,j]);
readln(f1);
end;
for i:=1 to n do
begin
max:=a[i,1];
for j:=1 to n do
if max<a[i,j] then max:=a[i,j];
writeln(f2,max);
end;
close(f1);
close(f2);
end.