Comparison of Continued Fractions
A finite continued (or simple) fraction of length n is expressed as:
Here, a_0 is an integer, and a_i (1 ≤ i ≤ n) are natural numbers.
Your task is to compare the values of two given finite continued fractions.
Input
The first line of input provides the length of the first continued fraction m, followed by m integers a_0, ..., a_{m-1}, which define the first continued fraction. The second line similarly describes the second continued fraction with integers [b_0, b_1, ..., b_{n−1}]. Constraints are as follows: 1 ≤ m, n ≤ 10^5, −10^9 ≤ a_0, b_0 ≤ 10^9, and 1 ≤ a_i, b_i ≤ 10^9 for i > 0.
Output
Output a single line with less if the first fraction's value is less than the second's, great if the first fraction's value is greater, or equal if both values are the same.