Virus

Find the rational point (X, Y, Z) closest to the origin satisfying N linear inequalities in three variables, or report that none exists.

Hard8GeometryMathBinary searchNo attempts yetTime limit1sMemory limit128 MB

Problem

The secret organization K recently built a computer virus so powerful that it can break into any computer in the world. They put the virus on a memory card and locked the card in a safe that opens with a combination of three real numbers XX, YY, and ZZ. The combination is not necessarily unique. Because the virus is very dangerous, organization K does not want every secret agent to know the combination. So each agent received one piece of information, arranged so that no agent can open the safe alone; the safe can be opened only with the information of all the agents together. Each piece of information consists of four integers AA, BB, CC, and DD and states that the combination of the safe satisfies

AX+BY+CZDA \cdot X + B \cdot Y + C \cdot Z \le D

Mirko is afraid that organization K could use the virus to destroy the servers of his favorite computer game, where he raises chickens and plants carrots with his neighbor Slavko. He stole the information from all the secret agents of organization K and wants to break into the safe and destroy the virus. There is a problem, though. Mirko does not know how to build the combination of the safe from a list of inequalities.

Help Mirko find a combination (X,Y,Z)(X, Y, Z) that satisfies all the inequalities. If there are several, you must find the one closest to the origin, that is, the one with the smallest X2+Y2+Z2X^2 + Y^2 + Z^2. The set of points satisfying all the inequalities is closed and convex, so whenever a combination exists, exactly one such combination exists.

Input

The first line contains an integer NN (1N1001 \le N \le 100), the number of agents.

Each of the next NN lines contains four integers AiA_i, BiB_i, CiC_i, and DiD_i (1000Ai,Bi,Ci,Di1000-1000 \le A_i, B_i, C_i, D_i \le 1000).

Output

Among all real combinations with AiX+BiY+CiZDiA_i \cdot X + B_i \cdot Y + C_i \cdot Z \le D_i for every ii from 11 to NN, print the combination (X,Y,Z)(X, Y, Z) with the smallest X2+Y2+Z2X^2 + Y^2 + Z^2 on a single line, separated by spaces.

The coordinates of this combination are always rational, and you must print each one exactly as an irreducible fraction. If a coordinate is an integer, print just that integer (for example 0 or -5). Otherwise print it as p/q, where q2q \ge 2, pp and qq are coprime, and the sign of a negative value goes before pp (for example -3/5).

If no combination satisfies all the inequalities, print banana.

Hint

In the first example, the known information about the combination of the safe is:

X+Y4X + Y \le 4
Y+2Z3Y + 2Z \le -3
X2X \le 2
X1-X \le -1

The combination (1.5,2,5)(1.5, 2, -5), for example, also satisfies all the inequalities. However, the combination closest to the origin is (1,35,65)(1, -\frac{3}{5}, -\frac{6}{5}), where X2+Y2+Z2=145X^2 + Y^2 + Z^2 = \frac{14}{5}. So the answer is 1 -3/5 -6/5.