LogiQuest

474. Compare Version Numbers

MediumParsing

Compare two version strings revision by revision (leading zeros ignored, missing revisions count as 0). Print -1, 0 or 1.

Input format

Line 1: version1 Line 2: version2

Output format

-1, 0 or 1

Example 1

Input

1.01
1.001

Output

0

Example 2

Input

1.0
1.0.0

Output

0

Constraints

1 ≤ lengths ≤ 500

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…