Program Pr1;
uses crt;
var stroka:string;
i:integer;
Begin
clrscr;
readln(stroka);
for i:=1 to length(stroka) do begin
if stroka[i]=' ' then delete(stroka,i,1)
else break;
end;
if stroka[length(stroka)]=' ' then delete(stroka,length(stroka),1);
for i:=1 to length(stroka) do if (stroka[i]=' ') and (stroka[i+1]=' ') then delete(stroka,i,1);
writeln(stroka);
end.