An infinite continued fraction is represented as:

Here, a_0 is an integer, and a_i (i > 0) are natural numbers.
The value of an infinite continued fraction is defined as the limit of its finite approximations:

An infinite continued fraction is termed periodic if there exist integers p \geq 0 and t > 0 such that for any integer i \geq p, the condition a_i=a_{i+t} is satisfied.
In this scenario, it is expressed as [a_0, ..., a_{p−1}, (a_p, ..., a_{p+l−1})].
The first line of the input specifies the first fraction in the format [a_0, a_1, ..., a_{n−1}] (1 \leq n \leq 10), if it is finite, or in the format [a_0, ..., a_{p−1}, (a_p, ..., a_{p+l−1})] (p \geq 0, l > 0, p+l \leq 10), if it is periodic (-10^9 \leq a_0 \leq 10^9 for p > 0, 1 \leq a_i \leq 10^9 for i > 0). The second line similarly defines the second fraction.
On a single line of the output, print less if the value of the first fraction is less than the value of the second fraction, great if the first fraction is greater than the second, and equal if these values are equal.
Example 1