uses
crt;
var
s,temp:string;
i:integer;
begin
clrscr;
readln(s);
temp:='';
writeln('------: ');
for i:=1 to length(s) do
begin
if s[i]<>' ' then
temp:=temp+s[i];
if (s[i]=' ') or (i=length(s)) then
begin
if (temp<>'') and (temp[1]=temp[length(temp)]) then
write(temp,' ');
temp:=''
end;
end
end.