uses crt;
var s:string; i:integer;
begin
clrscr;
writeln('hay nhap xau');readln(s);
while s[1]=' ' do delete(s,1,1);
while s[length(s)]=' ' do delete(s,length(s),1);
for i:= 1 to length(s) do while (s[i]=' ') and (s[i+1]=' ') do delete(s,i,1) ;
s[1]:=upcase(s[1]);
for i:=1 to length(s) do if s[i-1]=' ' then s[i]:=upcase(s[i]);
writeln(s);
readln;
end.