var
a:array[1..100,1..100] of word;
n,p:byte;
i,j:byte;
procedure input;
var i,j:byte;
w:word;
Begin
For i:=1 to n do
              for j:=1 to p do begin
                               readln(w);
                               a[i,j]:=w;
                               end;
end;
function min:word;
var
mini:word;
begin
mini:=a[i,1];
for J:=1 to p do if mini>a[i,j] then begin
                                     mini:=a[i,j];
                                     end;
min:=mini;
end;
function max:word;
var
maxi:word;
begin
{j:=?}
maxi:=a[1,j];
for i:=1 to n do if maxi<a[i,j] then begin
                                     maxi:=a[i,j];
                                     end;
max:=maxi;
end;
function dpoj:boolean;
var br:byte;
begin
br:=0;
dpoj:=false;
for j:=1 to p do if a[i,j]=min then br
end;
function prostotiq:boolean;
begin
i:=1;
j:=1;
for i to
end;
BEGIN
readln(n,p);
i:=1;
j:=1;
input;

END.