While Mahmoud and Ehab were practicing for IOI, they found a problem which name was Longest common subsequence. They solved it, and then Ehab challenged Mahmoud with another problem.

Given two strings a and b, find the length of their longest uncommon subsequence, which is the longest string that is a subsequence of one of them and not a subsequence of the other.

A subsequence of some string is a sequence of characters that appears in the same order in the string, The appearances don't have to be consecutive, for example, strings "ac", "bc", "abc" and "a" are subsequences of string "abc" while strings "abbc" and "acb" are not. The empty string is a subsequence of any string. Any string is a subsequence of itself.


-----Input-----

The first line contains string a, and the second line — string b. Both of these strings are non-empty and consist of lowercase letters of English alphabet. The length of each string is not bigger than 10^5 characters.


-----Output-----

If there's no uncommon subsequence, print "-1". Otherwise print the length of the longest uncommon subsequence of a and b.


-----Examples-----
Input
abcd
defgh

Output
5

Input
a
a

Output
-1



-----Note-----

In the first example: you can choose "defgh" from string b as it is the longest subsequence of string b that doesn't appear as a subsequence of string a.

Difficulty: interview

Starter code:

Solutions:
import sys
a = input()
b = input()
if a != b:
    print(max(len(a), len(b)))
else:
    print(-1)


s = input()
t = input()
x = len(s)
y = len(t)
if s == t:print(-1)
else: print(max(x, y))


a = input()
b = input()

if a == b:
	print(-1)
else:
	print(max(len(a), len(b)))

#n = int(input())
#a, b = map(int, input())
a = input()
b = input()
#arr = list(map(int, input().split()))
if a != b:
    print(max(len(a), len(b)))
else:
    print(-1)

from sys import stdin, stdout

f = stdin.readline().strip()
s = stdin.readline().strip()

if f == s:
    stdout.write('-1')
else:
    stdout.write(str(max(len(s), len(f))))

a = input()
b = input()
if (a == b):
    print(-1)
else:
    print(max(len(a), len(b)))



A = input()
B = input()

if A == B:
    print(-1)
else:
    print(max([len(A), len(B)]))


a = input()
b = input()
if a == b:
    print(-1)
else:
    print(max(len(a), len(b)))


#!/bin/python3

import sys
a = input()
b = input()
if  a == b:
    print(-1)
    return
print(max(len(a),len(b)))

s = input()
s1 = input()
if s == s1:
    print(-1)
else:
    print(max(len(s), len(s1)))

s1 = input()
s2 = input()
if s1 == s2:
    print(-1)
else:
    print(max(len(s1), len(s2)))


s1 = input()
s2 = input()

if s1 == s2:
    print(-1)
else:
    print(max(len(s1), len(s2)))


a = input().strip()
b = input().strip()

if a == b:
	print(-1)
else:
	print(max(len(a), len(b)))

def __starting_point():
    a = input().strip()
    b = input().strip()

    if a == b:
        print(-1)
    else:
        print(max(len(a), len(b)))


__starting_point()

def myf(s,m):
    if (s == m):
        return (-1)
    else:
        return (max(len(s), len(m)))

s = input()  
m = input()  
res = myf(s,m)
print (res)

s1 = input()
s2 = input()
if s1 != s2:
    print(max(len(s1), len(s2)))
else:
    print(-1)


a=input()
b=input()
if a==b: print(-1)
else: print(max(len(a),len(b)))

a = input()
b = input()

if a == b:
    print(-1)
else:
    print(max(len(a), len(b)))

a=input()
b=input()
if a==b:
    print(-1)
else:
    print(max(len(a),len(b)))

s1 = input()
s2 = input()

if len(s1) != len(s2):
    print(max(len(s1), len(s2)))
elif s1 == s2:
    print(-1)
else:
    print(len(s1))

import sys

a = input()
b = input()
if a != b:
    print(max(len(a),len(b)))
else:
    print(-1)


s1 = input()
s2 = input()
if s1 == s2:
    print(-1)
else:
    print(max(len(s1), len(s2)))

a = input()
b = input()
if a == b:
    print(-1)
else:
    print(max(len(a), len(b)))


def __starting_point():
	a = input()
	b = input()
	if (a == b):
		print(-1)
	else:
		print(max(len(a), len(b)))
__starting_point()

a = input()
b = input()

if len(a) != len(b):
	print(max(len(a), len(b)))
else:
	if a != b:
		print(len(a))
	else:
		print(-1)