program xz;
uses crt;
var s:string[100];
i:integer;
begin
readln(s);
while s[1]=' ' do delete(s,1,1);
i:=2;
while i<=length(s) do
if (s[i]=' ') and (s[i-1]=' ') then delete(s,i,1)
else i:=i+1;
if (s[length(s)]=' ') then delete(s,length(s),1);
write(s);
readkey...