Given a string and a list of words of the same length, find all start indices in the string of concatenations of each word.

For example, for string "barfoomanthefoobar" and words ["foo", "bar"] the corresponding indices are [0,12].

Input. The input consists of two lines. The first line is the string where you will search for concatenations of words. The second line is the list of words. Words are separated by a single space.

Output.

Output consists of a single line. The line consists of all the indices separated by a single space. Order of the indices does not matter.

# Solution

Here is a Ruby implementation.