uses
crt;
const
dividers=[' ',',','.',';',':','-','=','+'];
var
a,b:array[1..128]of string;
s,temp1,temp2:string;
i,max1,max2,j:integer;
begin
clrscr;
writeln('----------:');
readln(s);
temp1:='';
temp2:='';
max1:=0;
max2:=0;
for i:=1 to length(s) do
begin
if not (s[i] in dividers) then
begin
temp1:=temp1+s[i];
if temp2<>'' then
begin
inc(max2);
b[max2]:=temp2;
temp2:=''
end;
end;
if (s[i] in dividers) or (i=length(s)) then
begin
temp2:=temp2+s[i];
if temp1<>'' then
begin
inc(max1);
a[max1]:=temp1;
temp1:=''
end;
end;
end;
for i:=1 to max1-1 do
for j:=i+1 to max1 do
if a[j]<a[i] then
begin
temp1:=a[j];
a[j]:=a[i];
a[i]:=temp1
end;
writeln('Itog:');
for i:=1 to max1 do
write(a[i],copy(b[i],1,1));
writeln
end.