Given a string of size , we define the -th rotation of (for ) as
Given two strings and , compute how many -th rotations of are equal to .
For instance, for
“abbabb” and
“babbab” the answer is 2, corresponding to
and
.
Input consists of several cases, each one with two strings and with only lowercase letters. Assume . Every letter appears the same number of times in and in .
For every case, print the number of -th rotations of that are equal to .
Input
abbabb babbab abc acb abba bbaa zzzzz zzzzz
Output
2 0 1 5