program in_xau_dao_nguoc;
var s : string;
xau: array[1..100] of string;
n,i,k:integer;
begin
write('Nhap vao chuoi ki tu ');readln(s);
n:=length(s);
i:=1;
k:=0;
while i<=n do
begin
if s<>' ' then
begin
k:=k+1;
tu[k]:='';
while (i<=n)and(s<>' ') do
begin
xau[k]:=xau[k]+s;
i:=i+1;
end;
end;
i:=i+1;
end;
for i:=k downto 1 do write(xau,' ');
readln
end.