The third round of the contest is about to start. To predict the scores, assume the following.
In every round, including the third one, a contestant can score any integer number of points from 0 to 650. The final standings list contestants from the largest sum of the points of all three rounds to the smallest. Contestants with an equal sum get the same place, and the next contestant gets the place that counts everyone ahead. For example, contestants with sums 1000, 1000, 900, 900 and 800 get places 1, 1, 3, 3 and 5.
You know the first round score and the second round score of all N contestants. Under the assumption above, find the highest and the lowest place each contestant can get in the final standings after all three rounds.
The first line contains the number of contestants N (1≤N≤500000).
Each of the next N lines contains the first round score and the second round score of one contestant. Both scores are integers from 0 to 650.
For each contestant, in the order given in the input, print two integers on one line: the highest and the lowest place that contestant can get.