Problem B
Bus Numbers
Your favourite public transport company LS (we cannot use
their real name here, so we permuted the letters) wants to
change signs on all bus stops. Some bus stops have quite a few
buses that stop there and listing all the buses takes space.
However, if for example buses
You are given a list of buses that stop at a bus stop. What is the shortest representation of this list?
Input
The first line of the input contains one integer
Output
Print the shortest representation of the list of bus numbers. Use the format as in the example, separate numbers with single spaces and output them in sorted order.
Sample Input 1 | Sample Output 1 |
---|---|
6 180 141 174 143 142 175 |
141-143 174 175 180 |