Windmill Animation

Time limit1sMemory limit128 MB

Problem

A windmill animation works as follows.

A set of points in the plane is given, no three of which are collinear. One of the points is chosen as the first pivot, and a line is drawn through it at some initial angle. The animation then rotates the line counter-clockwise about the pivot at a constant rate. As soon as the rotating line reaches another of the points, that point becomes the new pivot, and the rotation continues about it. (The line is undirected, so it reaches a point when its angle, taken modulo $180^\circ$, equals the direction from the current pivot toward that point.)

Given the set of points, the initial pivot, and the initial angle of the line, write a program that outputs the sequence of pivot points in the order they become the pivot. The rate of rotation does not affect the result; only the order in which points become pivots matters.

Input

The first line of input contains a single integer $P$ ($1 \le P \le 1000$), the number of data sets. The data sets are processed identically and independently.

The first line of each data set contains three integers $M$, $S$, $I$ and a floating-point value $A$, separated by spaces. $M$ ($3 \le M \le 20$) is the number of points, $S$ ($3 \le S \le 20$) is the number of pivot points to output, and $I$ ($1 \le I \le M$) is the index of the initial pivot. $A$ ($0 \le A < 180$) is the angle, in degrees, by which the initial line is rotated counter-clockwise from horizontal.

The next $M$ lines give the points: the $k$-th of these lines contains the $X$ and $Y$ coordinates (floating-point values) of the point with index $k$. No three points are collinear.

Output

For each data set, output a single line containing $S$ space-separated point indices: the points that become pivots, in order, starting with the first pivot after the initial one. (The initial pivot's index is not printed at the front, but it may appear later if it becomes a pivot again.)