Lines
Cyril boy once wrote to a paper line, consisting of large and small letters, and then went to play football. When he returned, he discovered that his friend Dima wrote under his string another line the same length. Dym argues that his line, he got a cyclic shift of the line of Cyril a few steps to the right (a cyclic shift of the line abcde at 2 positions to the right will give the line deabc). However, Dima known fact that might inadvertently be mistaken in a large number of calculations, so Cyril at a loss - whether to believe Dime? Help him! According to the data lines output the minimum possible size of the shift, or -1 if Dima was wrong.
Input
The first two lines of the input file contains rows of Cyril and Dima, respectively. The lengths of the strings are the same, do not exceed 10000, and is not equal to 0.
Output
The output file output a single number - the answer to our problem.