The input is a sequence of datasets. The end of the input is indicated by a line containing a zero.
Each dataset is formatted as follows.
k
px1 py1 qx1 qy1
.
.
.
pxk pyk qxk qyk
hx hy
For all datasets, the size of the initial sheet is 100 mm square, and, using mm as the coordinate unit, the corners of the sheet are located at the coordinates (0, 0), (100, 0), (100, 100) and (0, 100). The integer k is the number of folding instructions and 1 <= k <= 10. Each of the following k lines represents a single folding instruction and consists of four integers p
xi, p
yi, q
xi and q
yi, delimited by a space. The positions of point P and Q for the i-th instruction are given by (p
xi, p
yi) and (q
xi, q
yi), respectively. You can assume that P != Q. You must carry out these instructions in the given order. The last line of a dataset contains two integers hx and hy delimited by a space, and (hx, hy) represents the position of the pinhole.
You can assume the following properties:
The points P and Q of the folding instructions are placed on some paper segments at the folding time, and P is at least 0.01 mm distant from any borders of the paper segments.
The position of the pinhole also is at least 0.01 mm distant from any borders of the paper segments at the punching time.
Every folding line, when infinitely extended to both directions, is at least 0.01 mm distant from any corners of the paper segments before the folding along that folding line.
When two paper segments have any overlap, the overlapping area cannot be placed between any two parallel lines with 0.01 mm distance. When two paper segments do not overlap, any points on one segment are at least 0.01 mm distant from any points on the other segment.
For example, Figure 5 (a), (b), (c) and (d) correspond to the first four datasets of the sample input.