A laser beam generator, a target object, and some mirrors are placed on a plane. The mirrors stand upright on the plane, and both faces of each mirror are flat and reflect beams. Because the beam can reach the target after different sequences of reflections, several initial directions may hit the target. Your task is to find the shortest beam path from the generator to the target and report its length.
The figure below shows examples of possible beam paths; the bold line is the shortest one.

Examples of possible paths
The input consists of several datasets. A line containing a single zero marks the end of the input.
Each dataset has the following format. Every value in a dataset except $n$ is an integer between $0$ and $100$ inclusive.
$n$ $PX_1\ PY_1\ QX_1\ QY_1$ $\vdots$ $PX_n\ PY_n\ QX_n\ QY_n$ $TX\ TY$ $LX\ LY$
The first line of a dataset contains an integer $n$ ($1 \le n \le 5$), the number of mirrors. The next $n$ lines describe the mirrors: $(PX_i, PY_i)$ and $(QX_i, QY_i)$ are the two endpoints of mirror $i$. No two mirrors touch each other. The last two lines give the target position $(TX, TY)$ and the generator position $(LX, LY)$. The target and the generator are separated from each other, and both are separated from every mirror.
The target and the generator are small enough that their sizes can be ignored, and the mirrors have negligible thickness.
You may also assume the following about every dataset:
The first figure corresponds to the first example dataset. The figure below shows the shortest paths for the remaining example datasets.

Examples of the shortest paths
For each dataset, print a single line with the length of the shortest path from the generator to the target, rounded to exactly three digits after the decimal point (for example, 90.510). Do not print any extra characters.