Teleporting Firefly Chase

Time limit1sMemory limit128 MB

Problem

A remarkable new insect, the Lampyridae Teleportae (better known as the teleporting firefly), has been discovered. Instead of flying, it teleports from spot to spot by warping space-time. Whenever it stops, it hovers for a moment and flashes its light to search for a mate, so it is easy to observe but very hard to catch.

To catch one you wear teleporting tennis shoes. Each time the firefly flashes, you have exactly enough time to teleport once (never twice) before it teleports away again. Your shoes have a maximum teleport range that depends on their flux capacitor, so a single teleport may not be enough to reach the firefly.

The chase happens on a 2D plane measured in yards. You start at an integer position and wait. Each time the firefly flashes at some location, you teleport in a straight line directly toward that flash. If your maximum range is enough to end up within one yard of the flash, you catch the firefly. Otherwise you teleport the full maximum range toward the flash (so after the first teleport your coordinates may be non-integer), then wait for the next flash and repeat.

The firefly is caught when you come within one yard of it, i.e. when the Euclidean distance between you and the flash is at most $1$. Simulate the chase for several scenarios. For each scenario, report either the flash location where the firefly was caught, or that it was never caught.

Input

The input contains several chase scenarios.

The first line of a scenario has three space-separated integers: the maximum teleport range, and the starting $x$- and $y$-coordinates of the chaser. The maximum range is an integer from $1$ to $1000$; the starting coordinates are integers from $0$ to $1000$.

Each following line has two space-separated integers, the $x$- and $y$-coordinates of one firefly flash, in the order they occur. All coordinates range from $0$ to $1000$. A line with both coordinates equal to $-1$ ends the flash list, at which point the firefly is gone forever. If the firefly is caught before the end of the list, the remaining flashes of that scenario are ignored.

The next scenario begins on the line immediately after the previous scenario's terminator. A scenario whose maximum range is $0$ ends the input and is not processed.

Output

For each scenario, print exactly one line.

If the firefly is caught, print Firefly N caught at (x,y), where N is the scenario number (starting at $1$) and (x,y) is the flash location at which it was caught. If the firefly is never caught, print Firefly N not caught.