Given a string of even length s=s_1…s_n, we define shuffle operation which transforms a string into a new string according to the following rule:
shuffle(s)=s_1s_3…s_n−1s_2s_4…s_n
For example, shuffle(abcdef)=acebdf.
You are given two strings of equal even length, s and t. How many times do you have to apply shuffle operation to s in order to get t as a result?
In the other words, find minimum k such that shuffle(shuffle(…shuffle_k times(s)…))=t or report that it is not possible to reach t in any number of operations.
The first line of input contains a string s, the second contains a string t (∣s∣=∣t∣, 2≤∣s∣≤106, ∣s∣ is even). Both strings consist of lowercase English characters.
Print minimum non-negative k such that it is possible to obtain t from s by applying shuffle operation k times (or maybe not applying at all if k=0), or print -1 if it is impossible.