시간 제한메모리 제한제출정답맞힌 사람정답 비율
1.5 초 (추가 시간 없음) 256 MB111100.000%

문제

Two old pals, Cardanieux and Ferrarineux, love mathematical competitions: one of them emails the other a mathematical problem, with week to solve it. If the friend fails to cope with the problem in a week, he loses.

Ferrarineux came up with yet another problem and has already sent it to his friend. Cardanieux has just read the new challenge --- he's got a big pile of cubic equations of the shape $ax^3+bx^2+cx+d=0$, and the challenge is to multiply all this polynomials and find an integer, such that it is root of the largest multiplicity of the product. Cardanieux is very worried: he has lost three times in a row. This time, he just cannot afford to lose. He is asking you to write a program which will find a solution to the challenge, so that he can disappoint his friend with a lighting-fast correct answer.

입력

The first line of the input file contains a single integer $n$ --- the number of the equations ($1\le n\le 10^5$). It is followed by $n$ lines, with each $i$th line containing four integers $a_i$, $b_i$, $c_i$ and $d_i$, which are all non-zero --- the coefficients of the $i$th equation $a_i x^3 + b_i x^2 + c_i x + d_i = 0$ ($0\le |a_i|, |b_i|, |c_i|, |d_i|\le 10^9$).

It is guaranteed that all numbers $a_i$ are non-zero.

출력

If none of the equations has an integer root, print a single line NO. Otherwise, in the first line of the input file, print the YES. In the second line, print two space-separated integers --- the first one is the root of the largest multiplicity of the product of these equations, and the second one is the multiplicity.

If there are several solutions, print any of them.

예제 입력 1

2
1 3 3 1
2 2 0 0


예제 출력 1

YES
-1 4


예제 입력 2

1
1 1 1 2


예제 출력 2

NO


힌트

In the first example the product of the polynomials equals

$$\begin{equation*} (x^3 + 3x^2 + 3x + 1) \cdot (2 x^3 + 2 x^2) = 2 x^2 (x + 1)^4 \end{equation*}$$

The number 0 is a root of multiplicity 2 and the number -1 is a root of multiplicity 4.

In the second example there are no integer roots.