Brownie Points I

Time limit1sMemory limit128 MB

Problem

Stan and Ollie play the game of Odd Brownie Points. A number of brownie points sit in the plane at integer coordinates. Stan moves first and draws a vertical line. This line must pass through at least one brownie point, and it may pass through several points that share the same $x$-coordinate. Ollie then draws a horizontal line, which must pass through a brownie point that already lies on Stan's vertical line.

The two lines split the plane into four quadrants. The quadrant that contains points with arbitrarily large positive coordinates is the top-right quadrant.

Each player scores from the brownie points inside the quadrants. A brownie point that lies on either line (i.e., a line passes through it) counts for no one. Stan earns one point for every uncrossed brownie point in the top-right and bottom-left quadrants. Ollie earns one point for every uncrossed brownie point in the top-left and bottom-right quadrants.

Given the point through which both lines are drawn, compute Stan's and Ollie's scores.

Input

The input contains several test cases. The first line of each test case holds a positive odd integer $n$ ($1 < n < 200000$), the number of brownie points. Each of the next $n$ lines holds two integers: the $x$-coordinate and the $y$-coordinate of one brownie point. No two brownie points share the same location. The input ends with a line that contains a single $0$ in place of $n$.

Output

For each test case, print one line with two integers separated by a single space: Stan's score followed by Ollie's score. Both lines are drawn through the point that lies exactly in the middle of that test case's list of points, i.e., the $\frac{n+1}{2}$-th point given.