Vectors have their directions and two vectors make an angle between them. Given a set of three-dimensional vectors, your task is to find the pair among them that makes the smallest angle.

The input is a sequence of datasets. A dataset specifies a set of three-dimensional vectors, some of which are directly given in the dataset and the others are generated by the procedure described below.

Each dataset is formatted as follows.

mnSWx_{1}y_{1}z_{1}x_{2}y_{2}z:_{2}x_{m}y_{m}z_{m}

The first line contains four integers `m`, `n`, `S`, and `W`.

The integer `m` is the number of vectors whose three components are directly specified in the
dataset. Starting from the second line, `m` lines have the three components of `m` vectors. The `i`-th line of which indicates the vector `v _{i}` = (

The integer `n` is the number of vectors generated by the following procedure.

int g = S; for(int i=m+1; i<=m+n; i++) { x[i] = (g/7) %100 + 1; y[i] = (g/700) %100 + 1; z[i] = (g/70000)%100 + 1; if( g%2 == 0 ) { g = (g/2); } else { g = (g/2) ^ W; } }

For `i = m + 1, . . . , m + n`, the `i`-th vector `v _{i}` of the set has three components x[i], y[i], and z[i] generated by this procedure.

Here, values of S and W are the parameters `S` and `W` given in the first line of the dataset. You may assume 1 ≤ `S` ≤ 10^{9} and 1 ≤ `W` ≤ 10^{9}.

The total number of vectors satisfies 2 ≤ `m + n` ≤ 12 × 10^{4}. Note that exactly the same vector may be specified twice or more in a single dataset.

A line containing four zeros indicates the end of the input. The total of `m+n` for all the datasets in the input never exceeds 16 × 10^{5}.

For each dataset, output the pair of vectors among the specified set with the smallest non-zero angle in between. It is assured that there are at least two vectors having different directions.

Vectors should be indicated by their three components. The output for a pair of vectors `v _{a}` and

x_{a}y_{a}z_{a}x_{b}y_{b}z_{b}

Two vectors (`x _{a}`,

If more than one pair makes the equal smallest angle, the pair that is the smallest among them in the dictionary order between vector pairs should be output. The pair (`v _{i}`,

4 0 2013 1124 1 1 1 2 2 2 2 1 1 1 2 1 2 100 131832453 129800231 42 40 46 42 40 46 0 100000 7004674 484521438 0 0 0 0

1 1 1 1 2 1 42 40 46 83 79 91 92 92 79 99 99 85

Source: ACM International Collegiate Programming Contest
, Asia Regional Aizu, Aizu, Japan, 2013-11-24

http://sparth.u-aizu.ac.jp/icpc2013

http://sparth.u-aizu.ac.jp/icpc2013