List#2100

List

1 second
64 megabytes
Very easy

At a company that manufactures computer components, each product is assigned a sequential number. After production, every product undergoes quality control, where it is either approved for sale or marked as defective and added to a list. Sometimes, this list of defective products becomes excessively long. To make it shorter, consecutive numbers are condensed into a range, represented by the first and last numbers of the sequence separated by a dash. For example, instead of listing:

1,3,4,5,6,7,8,10,12,16,17,20,21,22,23,24

it is written as:

1,3-8,10,12,16-17,20-24

Write a program that, given the complete list of defective product numbers, outputs it in the shortened format.

Input

First, input the number — the number of defective products. Then input the defective product numbers in ascending order (1 \leq M \leq N \leq 100).

Output

Print the defective product numbers in the shortened format on a single line. Ranges should be separated by commas, and there should be no spaces in the output.

Examples

Example 1

Loading
Loading