JMU CS280 SP18 WK08

Start

2018-02-27 21:30 CET

JMU CS280 SP18 WK08

End

2018-03-03 05:59 CET
The end is near!
Contest is over.
Not yet started.
Contest is starting in -172 days 7:28:28

Time elapsed

80:29:00

Time remaining

0:00:00

Problem D
String Matching

Input

The input consists of several test cases. Each test case consists of two lines, first a non-empty pattern, then a non-empty text. Input is terminated by end-of-file. The input file will not be larger than 5 Mb.

Output

For each test case, output one line containing the positions of all the occurences of pattern in text, from first to last, separated by a single space.

Sample Input 1 Sample Output 1
p
Popup
helo
Hello there!
peek a boo
you speek a bootiful language
anas
bananananaspaj
2 4

5
7