uses crt;
var st,s1,s2:string;
i,max,x,y,d1,d2:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
s1:=#32;
for i:=1 to length(st) do
if st[i] in ['a'..'z'] then s1:=s1+st[i];
d1:=length(s1);
for i:=1 to d1 do
s1[i]:=upcase(s1[i]);
writeln('Xau ky tu da chuyen sang hoa la: ',s1);
s2:=#32;
for i:=1 to length(st) do
if st[i] in ['0'..'9'] then s2:=s2+st[i];
write('Day so dao nguoc la: ');
d2:=length(s2);
for i:=d2 downto 1 do
write(s2[i]);
writeln;
max:=0;
for i:=1 to d2 do
begin
val(s2[i],x,y);
if max<x then max:=x;
end;
writeln('Chu so lon nhat la: ',max);
readln;
end.