Which One is Larger

시간 제한1초메모리 제한2048 MB

요약
두 소수 문자열이 주어질 때, 소수로 비교한 결과와 (정수부, 소수부 정수) 튜플로 비교한 결과가 같은지 판정한다.
난이도

쉬움10점 중 3점

유형
문자열, 구현
정답자
아직 제출이 없습니다

문제

A question that often confuses a chat bot is:

9.99.9 or 9.119.11, which one is larger?

Some chat bot would incorrectly state that 9.119.11 is larger than 9.99.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)(9, 11) > (9, 9). Integer tuples (x_1,y_1)(x\_1, y\_1) and (x_2,y_2)(x\_2, y\_2) are compared by first comparing x_1x\_1 against x_2x\_2, and if they are equal, then comparing y_1y\_1 against y_2y\_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 has two lines. Each line has one positive decimal numbers with 11 to 55 digits before the decimal point, and 11 to 55 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.014.01 converts to (4,1)(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 the decimal number that is larger if the comparison would be the same under integer tuple comparison and regular decimal comparison. Otherwise, output −1-1.

예제4

  1. 예제 1

    입력
    9.9
    9.11
    
    예상 출력
    -1
    
  2. 예제 2

    입력
    12.34
    5.6789
    
    예상 출력
    12.34
    
  3. 예제 3

    입력
    0.01
    0.009
    
    예상 출력
    -1
    
  4. 예제 4

    입력
    4.1
    4.01
    
    예상 출력
    -1