Problem

12 /21


*List

Problem

At a computer hardware company, all products are numbered sequentially from 1 to N. Each product, after its manufacture, enters the quality control department, where it is checked, and either goes on sale, or is entered in the list of defective products and written off. Unfortunately, the list of defective products is sometimes too long. Then, to reduce it, successive numbers are replaced by an interval: the numbers of the first and last items of the interval are indicated through a dash.
For example, instead of 
1,3,4,5,6,7,8,10,12,16,17,20,21,22,23,24
recorded
1,3-8,10,12,16-17,20-24
 
Write a program that, given the full list of defective product numbers, will display this list in an abbreviated form.
 
Input
In the first line, first enter the number N - the total number of products, then the number M - the number of products that turned out to be defective. In the second line, enter the numbers of defective products in ascending order products. 
 
Output
Output in one line a list of numbers of defective items in abbreviated form. Intervals must be separated by commas. There must be no spaces in the string.
 
Limits
1<=M<=N<=1000000.
 
Examples
# Input Output
1
10 5 
1 3 5 7 9
1,3,5,7,9
2
40 16
1 3 4 5 6 7 8 10 12 16 17 20 21 22 23 24
1,3-8,10,12,16-17,20-24
3
11 11
1 2 3 4 5 6 7 8 9 10 11
1-11
4
10000 1 
5
5