String Search - String Search

Time Limit : 1 sec, Memory Limit : 262144 KB
Japanese version is here

String Search

Find places where a string P is found within a text T. Print all indices of T where P found. The indices of T start with 0.

Input

In the first line, a text T is given. In the second line, a string P is given.

Output

Print an index of T where P found in a line. Print the indices in ascending order.

Constraints

  • 1 ≤ length of T ≤ 1000000
  • 1 ≤ length of P ≤ 10000
  • The input consists of alphabetical characters and digits

Sample Input 1

aabaaa
aa

Sample Output 1

0
3
4

Sample Input 2

xyzz
yz

Sample Output 2

1

Sample Input 3

abc
xyz

Sample Output 3


The output should be empty.