Bat Positioning

No attempts yetTime limit1sMemory limit128 MB

Problem

You are programming the movement of a bat (a disk) in a cooperative game. Several players each control a pointer on a $1000 \times 1000$ board. Every pointer is attached to the centre of the bat by an elastic cord, and the cords pull the bat until it settles at an equilibrium position where all the forces balance out. Given the pointer positions, compute the resting position of the bat.

The force from a pointer is proportional to its distance from the bat's centre and points toward the pointer. An elastic cord, however, has a minimum length of $100$ units: a pointer that is closer than $100$ units to the bat's centre exerts no force at all.

At equilibrium the net force is zero, so the bat rests at the average (centroid) of exactly those pointers that are at least $100$ units away from it. Since whether a pointer contributes depends on the final position, and that position depends on which pointers contribute, the two must be consistent with each other.

You may assume that no pointer finishes close to the $100$-unit limit, so the set of contributing pointers is never ambiguous.

For instance, with pointers at $(300, 400)$, $(600, 300)$ and $(600, 500)$ the bat settles at $(500, 400)$. If a fourth pointer is placed at $(550, 400)$, it lies within $100$ units of that position and therefore exerts no force, so the equilibrium stays at $(500, 400)$ (the dashed circle in the picture marks the $100$-unit limit).

Input

The input contains several game situations. Each situation begins with a line holding one integer $n$ ($0 \le n \le 30$), the number of pointers. The next $n$ lines each hold two integers $x$ and $y$ ($0 \le x, y \le 1000$) separated by a space, the coordinates of one pointer. The input ends with a situation in which $n = 0$; that situation is not processed.

Output

For each game situation, print one line with the equilibrium position of the bat's centre in the form (x,y), with both coordinates rounded to the nearest integer.