uses crt;
var st:ansistring;
i,d,max,dem,j,vt:integer;
begin
clrscr;
write('Nhap xau:'); readln(st);
d:=length(st);
max:=0;
for i:=1 to d-1 do
if st[i] in ['A'..'Z'] then
begin
dem:=1;
for j:=i+1 to d do
begin
if st[j] in ['A'..'Z'] then inc(dem);
if (j=d) and (max<=dem) and (st[j] in ['A'..'Z']) then
begin
max:=dem;
vt:=j;
end;
if not(st[j] in ['A'..'Z']) then
if max<=dem then
begin
max:=dem;
vt:=j-1;
break;
end
else break;
end;
end;
if max=0 then writeln('khong co')
else begin
for i:=vt-max+1 to vt do
write(st[i]);
end;
readln;
end.