s;n;p;main(c){for(;~c;p=c)c=getchar(),c+~p?n=p&&!printf(n>1?"%c-%c":"%c%c"+2*!n,s,p),s=c:n++;}