Problem: The numbers are colored with colors. These colors are indexed by . For each , there are exactly numbers colored with color .
Let denote the interval of integers between and inclusive, that is, the set . You must choose intervals such that:
- for each , it holds ;
- for each , the numbers and are colored with color ;
- each number belongs to at most intervals.
One can show that such a family of intervals always exists under the given constraints.
Input Format: The first line contains two integers and (, ) — the number of colors and the number of occurrences of each color.
The second line contains integers (), where is the color of number . It is guaranteed that, for each , it holds for exactly distinct indices .
Output Format: Output lines. The -th line should contain the two integers and .
If there are multiple valid choices of the intervals, output any.
Note: In the first sample, each number can be contained in at most intervals. The output is described by the following picture:
In the second sample, the only interval to be chosen is forced to be , and each number is indeed contained in at most interval.
In the third sample, each number can be contained in at most intervals. The output is described by the following picture: