# Arup Guha
# 11/16/2024
# Solution to 2024 SER D2 Problem E: Which One is Larger?

# Get input as string and float.
s1 = input().strip()
s2 = input().strip()
v1 = float(s1)
v2 = float(s2)

# Parse out two integers.
p1 = [x for x in s1.split(".")]
p2 = [x for x in s2.split(".")]

# There's a winner by the integer part.
if int(p1[0]) != int(p2[0]):

    # This suffices to determine that winner.
    if int(p1[0]) > int(p2[0]):
        print(s1)
    else:
        print(s2)

# Now we're down to the decimal part.
else:

    # Case where first value is actually bigger than the second.
    if v1 > v2:

        # The two disagree so -1.
        if int(p1[1]) <= int(p2[1]):   
            print(-1)

        # Either way, it's the first one.
        else:
            print(s1)

    # Second value is bigger.
    elif v1 < v2:

        # Two disagree so -1.
        if int(p2[1]) <= int(p1[1]):
            print(-1)

        # Either way, second one wins.
        else:
            print(s2)

    # Tie case.
    else:
        print(-1)
