St Andrews Online Judge

f Naturaliser

By Kay Akashi

Time: 1000 ms
Memory: 256000 kB

The code judging system is only available during contests. Check out the github repo for test cases and solutions.

Please log in.

Problem Statement

Given 66 positive integers a1a_{1}, b1b_{1}, c1c_{1}, a2a_{2}, b2b_{2}, and c2c_{2}, you will think of a function f(x)=a1x2+b1x+c1a2x2+b2x+c2f(x) = \frac{a_{1}x^{2} + b_{1}x + c_{1}}{a_{2}x^{2} + b_{2}x + c_{2}}.

Your task is to find all xx such that f(x)f(x) is a positive integer. (xx is an integer). 0 is not a positive integer.

It is ensured that a1<a2a_{1} \lt a_{2}.

Constraints

1a1,b1,c1,a2,b2,c2,101 \leq a_{1}, b_{1}, c_{1}, a_{2}, b_{2}, c_{2}, \leq 10. a1<a2a_{1} \lt a_{2}.

Input

The input consists of 6 integers, a1a_{1}, b1b_{1}, c1c_{1}, a2a_{2}, b2b_{2}, and c2c_{2}, in a single line.

Output

List the possible xx in one line, in an increasing order. If there's no such xx, output "None" instead.

Examples

Input

3 5 8 4 9 3

Output

-5 -2 1

Explanation

f(x)=3x2+5x+84x2+9x+3f(x) = \frac{3x^{2} + 5x + 8}{4x^{2} + 9x + 3}. f(5)=1f(-5) = 1, f(2)=10f(-2) = 10, and f(1)=2f(1) = 2. No other value satisfies the condition.

Input

3 3 2 4 3 2

Output

0

Explanation

It is only x=0x = 0 that makes f(x)f(x) a positive integer, which is 11.

Input

3 3 5 4 5 7

Output

None

Explanation

Be aware that some types of f(x)f(x) don't have any xx that makes it a positive integer number. In this case, output "None".