Intervals

No attempts yetTime limit1sMemory limit128 MB

Problem

A point light source is mounted in the ceiling of a basement, and the floor is very sensitive to light. To protect the floor, we want to know which parts of it lie in shadow — that is, which parts receive no light because a pipe blocks the source.

The situation is modeled in 2D. The x-axis coincides with the floor. The light is a point source with integer coordinates $(b_x, b_y)$. Each pipe under the ceiling is modeled as a circle: pipe $i$ has integer center $(c_{i,x}, c_{i,y})$ and integer radius $r_i$. Because the pipes are solid, the circles never overlap; a pipe neither reflects light nor lets light pass through it.

Write a program that determines the non-overlapping intervals on the x-axis that receive no light from the source because they are shadowed by the pipes.

Input

The input consists of several blocks; each block except the last describes one situation in the basement.

The first line of a block contains an integer $N$ with $0 < N < 500$, the number of pipes. The second line contains two integers $b_x$ and $b_y$, separated by a single space, giving the coordinates of the light source. Each of the following $N$ lines contains three integers $c_{i,x}$, $c_{i,y}$ and $r_i$ (with $c_{i,y} + r_i < b_y$), separated by single spaces, describing one pipe.

The last block consists of a single line containing $N = 0$; it terminates the input and is not processed.

Output

For each input block (except the terminating one), output the intervals of the floor that receive no light. Print each interval on its own line as two real numbers — the left and right endpoints — separated by a single space and rounded to exactly two decimal places. Within a block the intervals are sorted by increasing x-coordinate. The results of two consecutive blocks are separated by a single empty line.