Computer scientists live on pizza. To eat a little more healthily they now finish a whole pizza slice by slice, carefully making sure the part still on the table never slides off.
The pizza is a homogeneous two-dimensional disc with center $p=(p_x,p_y)$ and radius $r$, cut into $n$ slices of identical size by $n$ straight cuts running from the center. One cut always runs along the positive $x$-axis (towards increasing $x$-values), and the slices are numbered $1,2,\dots,n$ counter-clockwise; slice $1$ lies directly above the positive $x$-axis and spans the angles from $0$ to $2\pi/n$.
You eat the slices one at a time, in any order you like. Because all slices meet at the center, whatever remains is always treated as one connected, rigid, flat object, no matter which slices have already been eaten. A connected, rigid, flat object stays on a convex, flat surface if and only if its center of gravity lies above the surface. Hence, after each slice is eaten, the center of gravity of the remaining slices must still lie over the table, or the pizza falls.
The table is shaped like a slice of pizza (a circular sector) and is never larger than a half-circle, so it is convex. It is given by three corners $t$, $u$, $v$ in counter-clockwise order, with $t$ as the apex (center of the sector). The edges $t,u$ and $t,v$ have equal length — the sector's radius — apart from tiny rounding errors.
All slices are congruent and have equal mass, so the center of gravity of any set of remaining slices is the average of those slices' centroids. The centroid of one slice (a circular sector of radius $r$ and central angle $2\pi/n$) lies on its bisector at distance $\dfrac{2,r,\sin(\pi/n)}{3,(\pi/n)}$ from $p$. In general the center of gravity of a region $s$ has $x$-coordinate $\left(\int_s x,ds\right)/\left(\int_s ds\right)$ and $y$-coordinate $\left(\int_s y,ds\right)/\left(\int_s ds\right)$, where the denominator is the area of $s$.
The input contains several test cases. Each test case is a single line
n (px,py) r (tx,ty) (ux,uy) (vx,vy)
where $n$ is the number of equal slices the pizza is cut into ($1 \le n \le 9$), followed by nine floating-point numbers: the center $p=(p_x,p_y)$ of the pizza, its radius $r$, and the three corners $t=(t_x,t_y)$, $u=(u_x,u_y)$, $v=(v_x,v_y)$ of the sector-shaped table in counter-clockwise order (with $t$ the apex). The distances from $t$ to $u$ and from $t$ to $v$ are equal except for very small rounding errors, and the table is never larger than a half-circle.
The input is terminated by a line containing a single $0$, which must not be processed.
For each test case, consider every eating order (a permutation of the slice numbers) such that, at every stage from the full pizza down to the last single slice, the center of gravity of the slices still on the table lies over the table. Among all such valid orders, output the lexicographically smallest one: print the slice numbers in the order they are eaten, each followed by a single space.
If no valid order exists, print the word impossible instead.
Two orders are compared lexicographically as sequences of slice numbers. Note that the center of gravity of the whole pizza equals its center $p$, so if $p$ does not lie over the table the answer is immediately impossible.