AT_abc466_b [ABC466B] Representative Balls
Description
There are $ N $ balls.
The color of the $ i $ -th ball is $ C_i $ , and its size is $ S_i $ . Here, the colors are represented by integers $ 1, 2, \ldots, M $ .
For $ k = 1, 2, \ldots, M $ , output the maximum size of a ball of color $ k $ , or `-1` if there is no ball of color $ k $ .
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ M $ $ C_1 $ $ S_1 $ $ C_2 $ $ S_2 $ $ \vdots $ $ C_N $ $ S_N $
Output Format
In the order $ k = 1, 2, \ldots, M $ , output the maximum size of a ball of color $ k $ if such a ball exists, or `-1` otherwise, separated by spaces.
Explanation/Hint
### Sample Explanation 1
The maximum size of a ball of color $ 1 $ is $ 7 $ , that of a ball of color $ 2 $ is $ 10 $ , and that of a ball of color $ 4 $ is $ 9 $ .
There is no ball of color $ 3 $ or color $ 5 $ .
### Constraints
- $ 1 \leq N, M \leq 100 $
- $ 1 \leq C_i \leq M $
- $ 1 \leq S_i \leq 100 $
- All input values are integers.