Var
i, n, m, j, max: integer;
ar: array[1..10000, 1..10000]of integer;
begin
randomize;
readln(n, m);
for i := 1 to n do
for j := 1 to m do
begin
ar[i, j] := random(1, 100);
if(i = 1) and (j = 1) then max := ar[1, 1];
if(ar[i, j] > max) then max := ar[i, j];
end;
writeln('Максимальный элемент:', max);
for i := 1 to n do
begin
for j := 1 to m do
write(ar[i, j]:4, ' ');
writeln;
end;
end.