Limits 1s, 512 MB

Java Development Kit (JDK) installer for Mac OS X has a bug:

Can you spot it? Notice how Java is checking the operating system version number. Logic dictates that 10.10.5 is obviously a newer version than 10.7.3. So something is incorrect in the way the installer trying to compare the version numbers. Can you come up with a correct algorithm? Do you have what it takes to get this right?

Input

There will be only one line with two version strings. Each version number can have no dots or at most two (.) dots. And there will be at most two consecutive digits (0 - 9) in the given version number.

Output

You need to print out the latest version number comparing the given two versions. If the both version numbers are the same print the string that is longest in terms of string length.

Samples

InputOutput
10.11.12 10.99.99
10.99.99
InputOutput
11.1 1.11
11.1

In the second sample case 1.11 can be considered as 01.11.00 and 11.1 can be considered as 11.01.00.

Submit

Login to submit.

Contributors

Statistics

60% Solution Ratio
musa.cse12Earliest, May '16
Tarik.amtolyFastest, 0.0s
TSRaihanLightest, 0 B
bokaifShortest, 152B
Toph uses cookies. By continuing you agree to our Cookie Policy.