SP32 NHAY - A Needle in the Haystack

Description

Write a program that finds all occurences of a given pattern in a given input string. This is often referred to as finding a _needle_ in a _haystack_. The program has to detect **all** occurences of the needle in the haystack. It should take the needle and the haystack as input, and output the positions of each occurence, as shown below. The suggested implementation is the KMP algorithm, but this is not a requirement. However, a naive approach will probably exceed the time limit, whereas other algorithms are more complicated... The choice is yours.

Input Format

N/A

Output Format

N/A

Explanation/Hint

Note the double empty line in the output, which means that no match was found for the second test case. **Warning: large Input/Output data, be careful with certain languages**