var
f1,f2: TextFile;
p: Byte;
St,TSt,S: String;
i: Integer;
begin
Assign(f1, 'Fi.txt'); {Устанавливается путь к файлу}
Reset(f1); {Открытие файла}
Assign(f2, 'Fo.txt'); {Устанавливается путь к файлу}
Rewrite(f2); {Создание файла}
while not EOF(f1) do
begin
Readln(f1, TSt); {Читаем строку из файла}
for i:=1 to Length(TSt) do
begin
repeat
p:=Pos(' ',TSt);
if p>0 then Delete(TSt,p,1);
until p=0;
end;
for i:=1 to Length(TSt) do
begin
if TSt[i]<>' ' then
begin
St:=St+TSt[i];
end
else
if Length(St)<>1 then
begin
S:=S+' '+St;
St:='';
end
else St:='';
end;
If length(St) > 1 Then S:=S+' '+St;
Writeln(f2, S);
S:='';
St:='';
end;
CloseFile(f1); {Oкончание процедур работы с файлами (закрытие файла)}
CloseFile(f2); {Oкончание процедур работы с файлами (закрытие файла)}