Var
P,i: Integer;
S,W,RW: String;
begin
clrscr;
writeln('Введите текст');
readln(s);
W := '';
while True do begin
P := Pos(' ', S);
if P = 0 then
begin
for I := Length(s) downto 1 do
w:= W + s[i];
Break;
end;
RW := Copy(S, 1, P-1);
for I := Length(RW) downto 1 do
W := W + RW[i];
S := Copy(S, P+1, Length(S));
w:=w+' ';
end;
WriteLn(W, ' ');
readkey;
end.