function dele (s : string) : string;
var l,i : integer;
begin
l := Length (s);
i := l;
while i>0 do
begin
if (s[i] = ' ') and (iif s[i+1] = ' ' then
begin
delete (s,i,1);
i := i -1;
end;
i := i -1;
end;
Result := s;
end;
var
a : string;
begin
readln (a);
writeln (dele(a));
end.