program r16_45;
uses crt;
var s:string;
      max:char;
      n,n_max:byte;
      i:integer;
BEGIN
writeln('Введите строку');readln(s);
while s[1]=' ' do delete(s,1,1);
 n:=length(s);
 n_max:=0;
  max:=pred('0');
  i:=1;
  while (i<=n) and (max<'9') do
   begin
    if (s[i]>='0') and(s[i]<='9') and(s[i]>max)
    then begin max:=s[i]; n_max:=i;
  end;
   i:=i+1;
end;
if n_max =0
 then writeln('Цифр в строке нет')
else writeln('Максимальная цмфра: ',max,' ','ее ноиеp: ',n_max);
END.