I. Username
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Minecraft usernames

Tiago Domingos wants to create a Minecraft account to play with his friend Tiago Gonçalves. For the choice of the username he wants to be as original as possible.

Domingos' username can be represented by a string $$$D$$$ and Gonçalves' by a string $$$G$$$. Now, to measure how original Domingos was, he finds the smallest continuous subsequence of $$$D$$$ that does not occur as a continuous subsequence of $$$G$$$, that is, the smallest substring of $$$D$$$ that is not a substring of $$$G$$$. Your task is to print the size of the smallest subsequence or warn if all substrings of $$$D$$$ are also substrings of $$$G$$$.

For example, if Tiago Domingos' username is $$$D = tdas$$$ and Gonçalves' is $$$G = tfg$$$, the answer is 1, because $$$a$$$, $$$d$$$, $$$s$$$ do not occur in G.

If $$$D = tdas$$$ and $$$G = tdas$$$, there is no substring that does not appear in $$$G$$$.

If $$$D = td$$$ and $$$G = tudo$$$, the smallest substring is $$$td$$$ of size 2.

Input

The first line has the string $$$D$$$ and the second has $$$G$$$. It is guaranteed that the strings contain only lowercase Latin letters ('a' to 'z') and that their size is at most $$$10^5$$$.

Output

The size of the smallest substring of $$$D$$$ that is not a substring of $$$G$$$. Print $$$-1$$$ if every substring of $$$D$$$ is also a substring of $$$G$$$.

Examples
Input
aba
abacaba
Output
-1
Input
aaba
aabbaa
Output
3
Input
tdas
tdas
Output
-1
Input
td
tudo
Output
2