Boondex has decided to improve its traffic jams coloring algorithm to better meet drivers' expectations. To achieve this, Boondex has collected feedback from drivers as a set of integer pairs V_i, C_i, where V_i is the driver's speed and C_i (C_i \in \{0, 1, 2\}) is the color that the driver expects to see on the map for this speed.
Help Boondex find two integers and (0 \leq A \leq B) that will be used in the new traffic jams coloring algorithm. The color will be if 0 \leq V \leq A, if A+1 \leq V \leq B, and if B+1 \leq V. Values and should be chosen to minimize the number of cases in which the algorithm's selected color differs from the driver's expected color. Among all pairs and that minimize this count, choose the pair with the smallest A+B sum.
The first line contains the integer (1 \leq N \leq 10^5), the number of data pairs collected from drivers. The next lines each contain two integers V_i (0 \leq V_i \leq 10^6) and C_i (C_i \in \{0, 1, 2\}): the driver's speed and the expected color for that speed.
Print two integers and .
Example 1