Input

Output

Example Input:

1000
1001
1002
2008
2009

Example Output:

100[0-2]
200[89]