Polynomial sign
/

## Easy-Medium, Linear Algebra, Mathematics

Problem
Editorial
Analytics

Consider a polynomial function $f(x)$ with integer coefficients: $a_0 + a_1 \cdot x + ... + a_n \cdot x^n$. Lets define $superBig = 10000^{10000^{10000}}$. Someone really wants to know $sgn(f(superBig))$ and $sgn(f(-superBig))$. Please, help him to find the sign of these values. Note that $a_n$ can be zero.

Input format

The first line contains single integer n ($0 \leq n \leq 3 \cdot 10^5$).

The second line contains $n+1$ space separated integers $a_i$ ($-10^{18} \leq a_i \leq 10^{18}$) - the coefficients of polynomial.

Output format

Print two space separated integers $sgn(f(superBig))$ and $sgn(f(-superBig))$.

Note that these values can be only 1, 0 or 1.

SAMPLE INPUT
1
-100 1

SAMPLE OUTPUT
1 -1

Explanation
• $sgn(f(superBig)) =sgn(superBig - 100) = 1$, $superBig - 100 > 0$
• $sgn(f(-superBig)) =sgn(-superBig - 100) = -1$, $-superBig - 100 < 0$
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 512 MB
Source Limit: 1024 KB

## This Problem was Asked in

Initializing Code Editor...