Hide

Problem E
Which One is Larger

A question that often confuses a chat bot is:

$9.9$ or $9.11$, which one is larger?

Some chat bot would incorrectly state that $9.11$ is larger than $9.9$. Though we are not exactly sure what reasoning is behind that wrong answer, one hypothesis is that the chat bot might have compared the decimal numbers as integer tuples and thought that $(9, 11) > (9, 9)$. Integer tuples $(x_1, y_1)$ and $(x_2, y_2)$ are compared by first comparing $x_1$ against $x_2$, and if they are equal, then comparing $y_1$ against $y_2$.

Your task is to determine given two decimal numbers whether their comparison would confuse a chat bot that may use integer tuple comparison. That is, you want to check if the comparison result would be the same under integer tuple comparison and regular decimal comparison.

Input

Input has two lines. Each line has one positive decimal number with $1$ to $5$ digits before the decimal point, and $1$ to $5$ digits after the decimal point. There are no leading or trailing zeros (a single zero before or after the decimal point is possible). The two decimal numbers are not equal.

You may assume that the chat bot discards any leading zeros when converting the digits after the decimal point to an integer in a tuple, e.g. $4.01$ converts to $(4, 1)$. Note that it is possible that the two numbers are equal by integer tuple comparison, in which case it is considered to be a different result than the result of a regular decimal comparison.

Output

Output the decimal number that is larger if the comparison would be the same under integer tuple comparison and regular decimal comparison. Otherwise, output $-1$.

Sample Input 1 Sample Output 1
9.9
9.11
-1
Sample Input 2 Sample Output 2
12.34
5.6789
12.34
Sample Input 3 Sample Output 3
0.01
0.009
-1
Sample Input 4 Sample Output 4
4.1
4.01
-1

Please log in to submit a solution to this problem

Log in