Sufix Tree - Application 1 - Pattern Find
hard
Given a string S and a pattern P, print all occurrences of P in S. Use Suffix Tree only.
Constraints
|S| <= 10^5
Format
Input
Input consists of 2 lines First contains string S, second contains pattern P
Output
Print all the occurances of pattern in string
Example
Sample Input
abcbcc
bc
Sample Output
1
3