//PascalABC.Net
//NaaMan
var
a : array [1..20] of integer;
b : array [0..9] of integer;
i, max, j : integer;
begin
randomize;
for i := 0 to 9 do
b[i] := 0;
for i := 1 to 20 do begin
a[i] := random(0, 9);
b[a[i]] := b[a[i]] + 1;
write(a[i], ' ')
end;
writeln;
max := b[0];
for i := 1 to 9 do
if (b[i] > max) then begin
max := b[i];
j := i
end;
writeln('Номер максимального элемента ', j);
writeln('Встречается ', max, ' раз.')
end.